Ask Your Question
0

Insert custom apache options

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

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
1

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

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

Comments

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

lancherider gravatar imagelancherider ( 2016-01-29 09:48:14 -0500 )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

Stats

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

Seen: 52 times

Last updated: Jan 29 '16