move absent cron.d files to one-line statements to make grepping easier
[mirror/dsa-puppet.git] / modules / apache2 / manifests / init.pp
index 630d845..f3a598b 100644 (file)
@@ -16,6 +16,7 @@ class apache2 {
                require => Package['apache2'],
        }
 
+       apache2::module { 'reqtimeout': }
        apache2::module { 'info': }
        apache2::module { 'status': }
        apache2::module { 'headers': }
@@ -89,12 +90,26 @@ class apache2 {
        }
 
        apache2::config { 'pratchett':
-               source => 'puppet:///modules/apache2/pratchett',
+               ensure => 'absent',
+       }
+
+       apache2::config { 'headers':
+               source => 'puppet:///modules/apache2/headers',
+       }
+
+       apache2::config { 'disabled-service':
+               source => 'puppet:///modules/apache2/disabled-service',
        }
 
        apache2::module { 'mpm_event': ensure => absent }
-       apache2::module { 'mpm_worker': }
-       if $::lsbmajdistrelease > 7 {
+       if has_role('apache_prefork') {
+               apache2::module { 'mpm_worker': ensure => absent }
+               apache2::module { 'mpm_prefork': }
+       } else {
+               apache2::module { 'mpm_prefork': ensure => absent }
+               apache2::module { 'mpm_worker': }
+       }
+       if versioncmp($::lsbmajdistrelease, '7') > 0 {
                file { '/etc/apache2/mods-available/mpm_worker.conf':
                        content => template('apache2/mpm_worker.erb'),
                }
@@ -121,6 +136,10 @@ class apache2 {
                content => template('apache2/disabled-index.html'),
        }
 
+       file { '/var/log/apache2':
+               ensure => directory,
+               mode   => '0755',
+       }
        file { '/var/log/apache2/.nobackup':
                mode    => '0644',
                content => '',
@@ -166,4 +185,15 @@ class apache2 {
                content => template('apache2/ssl-key-pins.erb'),
                notify  => Exec['service apache2 reload'],
        }
+
+       file { '/etc/cron.d/puppet-export-scheduled-shutdown': ensure => absent, }
+       concat::fragment { 'dsa-puppet-stuff--apache-export-shutdown':
+               target => '/etc/cron.d/dsa-puppet-stuff',
+               content  => @(EOF)
+                       */2 * * * * root mkdir -p /run/dsa/shutdown-marker; if dsa-is-shutdown-scheduled; then echo 'system-in-shutdown' > /run/dsa/shutdown-marker/shutdown-in-progress; else rm -f /run/dsa/shutdown-marker/shutdown-in-progress; fi
+                       | EOF
+       }
+       apache2::config { 'local-scheduled-shutdown':
+               source  => 'puppet:///modules/apache2/local-scheduled-shutdown',
+       }
 }