diff --git a/manifests/init.pp b/manifests/init.pp index f6734bee52103c787759bf90f0c9e10908691ee4..f9607a542f7c5659c66db03feddafe6cb366ce22 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -30,6 +30,7 @@ class apache class apache::base { include apache + include apache::service package { 'httpd': @@ -41,7 +42,7 @@ class apache::base $apache::configdir: ensure => directory, recurse => true, purge => true, force => true, backup => false, - require => Package['httpd'], notify => Service['httpd']; + require => Package['httpd'], notify => Class[apache::service]; } # We do not want to blindly include things in the conf.d directory. ensure_line { @@ -50,8 +51,19 @@ class apache::base line => '##--Include conf.d/*.conf', pattern => '^\s*Include\s+conf\.d/\*\.conf\s*$', require => Package['httpd'], - notify => Service['httpd']; + notify => Class[apache::service]; } +} + + + +/* + * Helper class for abstracting dependencies on the Apache service. + * This is so others can do e.g. notify => Class[apache::service] instead + * of having to do notify => Service['httpd']. + */ +class apache::service +{ service { 'httpd': enable => true, ensure => $running,