summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2009-09-28 22:20:14 +0200
committermh <mh@immerda.ch>2009-09-28 22:20:14 +0200
commitae889343b2015087d43ca2536777637dfc5f8bca (patch)
tree3fa8997532e9ccfac89e25e6247d37747ddf188c
parent86aae35859dc1bceac71b6bb11be03cd3fd5d422 (diff)
downloadpuppet-lighttpd-ae889343b2015087d43ca2536777637dfc5f8bca.tar.gz
puppet-lighttpd-ae889343b2015087d43ca2536777637dfc5f8bca.tar.bz2
refactor everything into its own class, include shorewall rules if needed
-rw-r--r--manifests/base.pp29
-rw-r--r--manifests/init.pp47
-rw-r--r--manifests/ssl.pp5
3 files changed, 44 insertions, 37 deletions
diff --git a/manifests/base.pp b/manifests/base.pp
new file mode 100644
index 0000000..60f9d29
--- /dev/null
+++ b/manifests/base.pp
@@ -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;
+ }
+}
diff --git a/manifests/init.pp b/manifests/init.pp
index d44d4a2..11078aa 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -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
index 0000000..376f4ee
--- /dev/null
+++ b/manifests/ssl.pp
@@ -0,0 +1,5 @@
+class lighttpd::ssl inherits lighttpd {
+ if $use_shorewall {
+ include shorewall::rules::https
+ }
+}