Ask Your Question

Insert custom apache options

asked 2016-01-28 16:14:43 -0600

lancherider gravatar image

Is there a relatively simple way to add an apache configuration option that is not included in the puppetlabs:apache module? I have read a few posts that suggest creating a template file for this type of thing, but that seems like an overly complicated solution. Really, the included options in the module are fine for my purposes, but I need to add:

AgentHost /var/run/sockfile.sock

To the httpd.conf file (this is CentOS 7). Is there a best practice method for including non-standard apache options? Thanks!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-01-29 03:38:26 -0600

fvoges gravatar image

The module doesn't allow you to add something to the main config. But provides at least two mechanisms you can use to do what you need.

You can override the template used by the module. But this is a bad idea because the yo'd have to keep it updated every time you upgrade the module version.

Or much easier, you can create a file in $::apache::conf_dir and add your extra options. That's how the module adds vhosts and the configuration for the optional modules.

Here's a very minimal example:

include apache
file { "${::apache::conf_dir}/00agent_host.conf":
  ensure  => file,
  content => "AgentHost /var/run/sockfile.sock\n",
  notify  => Class['Apache::Service'],
edit flag offensive delete link more


Thanks, fvoges, that's just what I was looking for!

lancherider gravatar imagelancherider ( 2016-01-29 09:48:14 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2016-01-28 16:14:43 -0600

Seen: 71 times

Last updated: Jan 29 '16