Skip to content

Instantly share code, notes, and snippets.

@raphink
Created October 15, 2013 12:01
Show Gist options
  • Save raphink/6990498 to your computer and use it in GitHub Desktop.
Save raphink/6990498 to your computer and use it in GitHub Desktop.
`apache_directive` type and provider for Puppet. Context must exist before it is used (`VirtualHost` and `IfModule`)
<VirtualHost *:80>
Options Indexes FollowSymLinks MultiViews
</VirtualHost>
<IfModule mpm_prefork_module>
StartServers 4
</IfModule>
SetEnv SPECIAL_PATH /foo/bin
Apache_directive {
target => '/tmp/apache',
}
apache_directive { 'Vhost Options':
ensure => present,
name => 'Options',
args => ['Indexes', 'FollowSymLinks', 'MultiViews'],
args_params => 0,
target => '/tmp/apache',
context => 'VirtualHost[arg="*:80"]',
}
apache_directive { 'SetEnv':
ensure => present,
args => ['SPECIAL_PATH', '/foo/bin'],
}
apache_directive { 'StartServers for mpm_prefork_module':
ensure => present,
name => 'StartServers',
args_params => 0,
context => 'IfModule[arg="mpm_prefork_module"]',
args => 4,
}

apache_directive

Manages Apache directives

Parameters

  • args An array of directive arguments

  • args_params How many arguments are to be used as params

  • context The path where the directive is located. Expressed as an Augeas path expression.

  • ensure The basic property that the resource should be in. Valid values are present, absent.

  • name The directive name

  • target The config file to use

Providers

augeas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment