Move default webpage from apache to webserver module
authorPeter Palfrader <peter@palfrader.org>
Sun, 19 Aug 2018 09:43:10 +0000 (11:43 +0200)
committerPeter Palfrader <peter@palfrader.org>
Sun, 19 Aug 2018 09:43:10 +0000 (11:43 +0200)
modules/apache2/manifests/init.pp
modules/apache2/templates/default-index.html [deleted file]
modules/apache2/templates/disabled-index.html [deleted file]
modules/webserver/manifests/defaultpage.pp [new file with mode: 0644]
modules/webserver/manifests/init.pp
modules/webserver/templates/default-index.html [new file with mode: 0644]
modules/webserver/templates/disabled-index.html [new file with mode: 0644]

index ce7c927..d200391 100644 (file)
@@ -119,19 +119,6 @@ class apache2 {
                source => 'puppet:///modules/apache2/apache2.logrotate',
        }
 
-       file { [ '/srv/www', '/srv/www/default.debian.org', '/srv/www/default.debian.org/htdocs', '/srv/www/default.debian.org/htdocs-disabled' ]:
-               ensure  => directory,
-               mode    => '0755',
-       }
-
-       file { '/srv/www/default.debian.org/htdocs/index.html':
-               content => template('apache2/default-index.html'),
-       }
-
-       file { '/srv/www/default.debian.org/htdocs-disabled/index.html':
-               content => template('apache2/disabled-index.html'),
-       }
-
        file { '/var/log/apache2':
                ensure => directory,
                mode   => '0755',
diff --git a/modules/apache2/templates/default-index.html b/modules/apache2/templates/default-index.html
deleted file mode 100644 (file)
index c8c9c40..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
-<HTML>
-<HEAD>
-   <TITLE>Welcome to <%= @hostname %>!</TITLE>
-</HEAD>
-<BODY>
-
-<H1>Welcome to <%= @hostname %>!</H1>
-
-This is <%= @hostname %>, a system run by and for the <a href="https://www.debian.org/">Debian Project</a>.
-She does stuff.
-What kind of stuff and who our kind sponsors are you might learn on
-<a href="https://db.debian.org/machines.cgi?host=<%= @hostname %>">db.debian.org</a>.
-
-<P>
-<HR NOSHADE />
-<FONT size="-1">DSA</FONT>
-
-</BODY>
-</HTML>
diff --git a/modules/apache2/templates/disabled-index.html b/modules/apache2/templates/disabled-index.html
deleted file mode 100644 (file)
index 104efd4..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
-<HTML>
-<HEAD>
-   <TITLE>Welcome to <%= @hostname %>!</TITLE>
-</HEAD>
-<BODY>
-
-<H1>Welcome to <%= @hostname %>!</H1>
-
-This is <%= @hostname %>, a system run by and for the <a href="https://www.debian.org/">Debian Project</a>.
-<P>
-The service you have requested is currently disabled.
-<P>
-The reason for that and who our kind sponsors are you might learn on
-<a href="https://db.debian.org/machines.cgi?host=<%= @hostname %>">db.debian.org</a>.
-
-<P>
-<HR NOSHADE />
-<FONT size="-1">DSA</FONT>
-
-</BODY>
-</HTML>
diff --git a/modules/webserver/manifests/defaultpage.pp b/modules/webserver/manifests/defaultpage.pp
new file mode 100644 (file)
index 0000000..29c7e05
--- /dev/null
@@ -0,0 +1,15 @@
+#
+class webserver::defaultpage {
+       file { [ '/srv/www', '/srv/www/default.debian.org', '/srv/www/default.debian.org/htdocs', '/srv/www/default.debian.org/htdocs-disabled' ]:
+               ensure  => directory,
+               mode    => '0755',
+       }
+
+       file { '/srv/www/default.debian.org/htdocs/index.html':
+               content => template('webserver/default-index.html'),
+       }
+
+       file { '/srv/www/default.debian.org/htdocs-disabled/index.html':
+               content => template('webserver/disabled-index.html'),
+       }
+}
index 6ffcfaa..f73f8df 100644 (file)
@@ -1,5 +1,7 @@
 #
 class webserver {
+       include webserver::defaultpage
+
        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',
diff --git a/modules/webserver/templates/default-index.html b/modules/webserver/templates/default-index.html
new file mode 100644 (file)
index 0000000..c8c9c40
--- /dev/null
@@ -0,0 +1,20 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<HEAD>
+   <TITLE>Welcome to <%= @hostname %>!</TITLE>
+</HEAD>
+<BODY>
+
+<H1>Welcome to <%= @hostname %>!</H1>
+
+This is <%= @hostname %>, a system run by and for the <a href="https://www.debian.org/">Debian Project</a>.
+She does stuff.
+What kind of stuff and who our kind sponsors are you might learn on
+<a href="https://db.debian.org/machines.cgi?host=<%= @hostname %>">db.debian.org</a>.
+
+<P>
+<HR NOSHADE />
+<FONT size="-1">DSA</FONT>
+
+</BODY>
+</HTML>
diff --git a/modules/webserver/templates/disabled-index.html b/modules/webserver/templates/disabled-index.html
new file mode 100644 (file)
index 0000000..104efd4
--- /dev/null
@@ -0,0 +1,22 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<HEAD>
+   <TITLE>Welcome to <%= @hostname %>!</TITLE>
+</HEAD>
+<BODY>
+
+<H1>Welcome to <%= @hostname %>!</H1>
+
+This is <%= @hostname %>, a system run by and for the <a href="https://www.debian.org/">Debian Project</a>.
+<P>
+The service you have requested is currently disabled.
+<P>
+The reason for that and who our kind sponsors are you might learn on
+<a href="https://db.debian.org/machines.cgi?host=<%= @hostname %>">db.debian.org</a>.
+
+<P>
+<HR NOSHADE />
+<FONT size="-1">DSA</FONT>
+
+</BODY>
+</HTML>