]> gitweb.fluxo.info Git - puppet-lighttpd.git/commitdiff
refactor everything into its own class, include shorewall rules if needed
authormh <mh@immerda.ch>
Mon, 28 Sep 2009 20:20:14 +0000 (22:20 +0200)
committermh <mh@immerda.ch>
Mon, 28 Sep 2009 20:20:14 +0000 (22:20 +0200)
manifests/base.pp [new file with mode: 0644]
manifests/init.pp
manifests/ssl.pp [new file with mode: 0644]

diff --git a/manifests/base.pp b/manifests/base.pp
new file mode 100644 (file)
index 0000000..60f9d29
--- /dev/null
@@ -0,0 +1,29 @@
+class lighttpd::base {
+    package{'lighttpd':
+        ensure => installed,
+    }
+
+    service{lighttpd:
+        ensure => running,
+        enable => true,
+        hasstatus => true, 
+        require => Package[lighttpd],
+    }
+
+    file{'/etc/lighttpd/lighttpd.conf':
+        source => [ "puppet://$server/files/lighttpd/${fqdn}/lighttpd.conf",
+                    "puppet://$server/files/lighttpd/lighttpd.conf",
+                    "puppet://$server/lighttpd/lighttpd.conf" ],
+        require => Package['lighttpd'],
+        notify => Service['lighttpd'],
+        owner => root, group => 0, mode => 0644;
+    }
+
+    # ToDo: put that in a common module to share with apache
+    file { 'default_lighttpd_index':
+        path => '/var/www/lighttpd/index.html',
+        ensure => file,
+        content => template('lighttpd/default/default_index.erb'),
+        owner => root, group => 0, mode => 0644;
+    }
+}
index d44d4a2bdb7b0c12cc1837b14c3b2b2f3cb61993..11078aaceafa812b0d6ebcb815ca4945e8cb56b7 100644 (file)
@@ -2,43 +2,16 @@
 # Copyright (C) 2007 admin@immerda.ch
 # GPLv3
 
-
 class lighttpd {
-    case $operatingsystem {
-        default: { include lighttpd::base }
-    }
-}
-
-class lighttpd::base {
-    package{'lighttpd':
-        ensure => installed,
-    }
-
-    service{lighttpd:
-        ensure => running,
-        enable => true,
-        hasstatus => true, 
-        require => Package[lighttpd],
-    }
+  case $operatingsystem {
+    default: { include lighttpd::base }
+  }
 
-    file{'/etc/lighttpd/lighttpd.conf':
-        source => [ "puppet://$server/files/lighttpd/${fqdn}/lighttpd.conf",
-                    "puppet://$server/files/lighttpd/lighttpd.conf",
-                    "puppet://$server/lighttpd/lighttpd.conf" ],
-        require => Package['lighttpd'],
-        notify => Service['lighttpd'],
-        owner => root, group => 0, mode => 0644;
-    }
-
-    # ToDo: put that in a common module to share with apache
-    file { 'default_lighttpd_index':
-        path => '/var/www/lighttpd/index.html',
-        ensure => file,
-        content => template('lighttpd/default/default_index.erb'),
-        owner => root, group => 0, mode => 0644;
-    }
-
-    if $use_munin {
-        include lighttpd::munin
-    }
+  if $use_shorewall {
+    include shorewall::rules::http
+  }
+  if $use_munin {
+    include lighttpd::munin
+  }
 }
+
diff --git a/manifests/ssl.pp b/manifests/ssl.pp
new file mode 100644 (file)
index 0000000..376f4ee
--- /dev/null
@@ -0,0 +1,5 @@
+class lighttpd::ssl inherits lighttpd {
+  if $use_shorewall {
+    include shorewall::rules::https
+  }
+}