diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2009-11-05 18:10:08 -0200 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2009-11-05 18:10:08 -0200 |
commit | 1465e36abe173d5738e2afb74f7413fd02a34926 (patch) | |
tree | b00ab82bcddf423a34a4e78b2fc1168fb1240388 /manifests | |
parent | 7e07d48d16630d547b86670b4c66164b18f5492b (diff) | |
download | puppet-apache-1465e36abe173d5738e2afb74f7413fd02a34926.tar.gz puppet-apache-1465e36abe173d5738e2afb74f7413fd02a34926.tar.bz2 |
Ensuring mod_macro is enabled (2)
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/init.pp | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/manifests/init.pp b/manifests/init.pp index 8381ed0..14f4ecc 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -29,15 +29,14 @@ class apache { ensure => installed, } - package { "mod_macro": - name => "libapache2-mod-macro", - ensure => installed, + service { "apache": + ensure => running, require => Package["apache"], } - service { "apache": - ensure => running, - require => Package["apache", "mod_macro"], + module { "macro": + ensure => present, + require => "libapache2-mod-macro", } # apache mod_macro configuration @@ -47,14 +46,10 @@ class apache { owner => root, group => root, mode => 0644, + require => Module["macro"], notify => Service["apache"], } - module { "macro": - ensure => present, - require => "mod_macro", - } - # prepare variables to use in templates case $apache_sites_folder { '': { $apache_sites_folder = '/var/www/sites' } @@ -73,6 +68,7 @@ class apache { owner => root, group => root, mode => 0644, + require => File["/etc/apache2/conf.d/macros"], notify => Service["apache"], } @@ -101,21 +97,26 @@ class apache { case $ensure { 'present' : { exec { "/usr/sbin/a2enmod $name": - unless => "/bin/sh -c '[ -L ${apache2_mods}-enabled/${name}.load ] \ + unless => "/bin/sh -c '[ -L ${apache2_mods}-enabled/${name}.load ] \ && [ ${apache2_mods}-enabled/${name}.load -ef ${apache2_mods}-available/${name}.load ]'", - notify => Exec["force-reload-apache2"], - require => Package[$require], + notify => Exec["force-reload-apache2"], + require => Package[$require], } } 'absent': { exec { "/usr/sbin/a2dismod $name": - onlyif => "/bin/sh -c '[ -L ${apache2_mods}-enabled/${name}.load ] \ + onlyif => "/bin/sh -c '[ -L ${apache2_mods}-enabled/${name}.load ] \ && [ ${apache2_mods}-enabled/${name}.load -ef ${apache2_mods}-available/${name}.load ]'", - notify => Exec["force-reload-apache2"], - require => Package["apache2"], + notify => Exec["force-reload-apache2"], + require => Package["apache2"], } } default: { err ( "Unknown ensure value: '$ensure'" ) } } } + + exec { "force-reload-apache2": + command => "/etc/init.d/apache2 force-reload", + refreshonly => true, + } } |