Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

apache::directive - uses now apache::conf definition

  • Loading branch information...
commit ac1b849d1a101e6eb64b343a7c856fdad2631495 1 parent d38f229
Jeanneret Cedric cjeanneret authored
Showing with 9 additions and 18 deletions.
  1. +9 −18 manifests/directive.pp
27 manifests/directive.pp
View
@@ -2,7 +2,7 @@
== Definition: apache::directive
-Convenient wrapper around File[] resources to add random configuration
+Convenient wrapper around apache::conf resources to add random configuration
snippets to an apache virtualhost.
Parameters:
@@ -36,25 +36,16 @@
}
*/
-define apache::directive ($ensure="present", $directive="", $filename="", $vhost) {
-
- $fname = regsubst($name, "\s", "_", "G")
+define apache::directive ($ensure="present", $directive, $filename="", $vhost) {
include apache::params
- file{ "${name} directive on ${vhost}":
- ensure => $ensure,
- content => "# file managed by puppet\n${directive}\n",
- seltype => $operatingsystem ? {
- "RedHat" => "httpd_config_t",
- "CentOS" => "httpd_config_t",
- default => undef,
- },
- name => $filename ? {
- "" => "${apache::params::root}/${vhost}/conf/directive-${fname}.conf",
- default => "${apache::params::root}/${vhost}/conf/${filename}",
- },
- notify => Service["apache"],
- require => Apache::Vhost[$vhost],
+ apache::conf {$name:
+ ensure => $ensure,
+ path => "${apache::params::www}/${vhost}/conf",
+ prefix => 'directive',
+ filename => $filename,
+ configuration => $directive,
+ require => Apache::Vhost[$vhost],
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.