Move creation of /run/dsa/shutdown-marker to a new common webserver module
authorPeter Palfrader <peter@palfrader.org>
Sun, 19 Aug 2018 09:38:57 +0000 (11:38 +0200)
committerPeter Palfrader <peter@palfrader.org>
Sun, 19 Aug 2018 09:38:57 +0000 (11:38 +0200)
modules/apache2/manifests/init.pp
modules/webserver/manifests/init.pp [new file with mode: 0644]

index 5fa11d4..ce7c927 100644 (file)
@@ -7,6 +7,8 @@
 #   include apache2
 #
 class apache2 {
+       include webserver
+
        package { 'apache2':
                ensure => installed,
        }
@@ -182,13 +184,6 @@ class apache2 {
                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',
        }
diff --git a/modules/webserver/manifests/init.pp b/modules/webserver/manifests/init.pp
new file mode 100644 (file)
index 0000000..6ffcfaa
--- /dev/null
@@ -0,0 +1,10 @@
+#
+class webserver {
+       file { '/etc/cron.d/puppet-export-scheduled-shutdown': ensure => absent, }
+       concat::fragment { 'dsa-puppet-stuff--webserver-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
+       }
+}