diff options
author | mh <mh@immerda.ch> | 2012-06-05 20:07:08 -0300 |
---|---|---|
committer | mh <mh@immerda.ch> | 2012-06-05 20:07:08 -0300 |
commit | 09b77138a3cf505e82f1d5a8d20f794fe1db8434 (patch) | |
tree | 4be47d1fd07bc56b412c5ace110d5bd080375757 /manifests | |
parent | dbf5334ff24a3b94d52520a86c365c0227863a56 (diff) | |
download | puppet-lighttpd-09b77138a3cf505e82f1d5a8d20f794fe1db8434.tar.gz puppet-lighttpd-09b77138a3cf505e82f1d5a8d20f794fe1db8434.tar.bz2 |
new style for 2.7
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/base.pp | 8 | ||||
-rw-r--r-- | manifests/config/file.pp | 20 | ||||
-rw-r--r-- | manifests/init.pp | 10 | ||||
-rw-r--r-- | manifests/ssl.pp | 2 | ||||
-rw-r--r-- | manifests/vhost/file.pp | 53 |
5 files changed, 46 insertions, 47 deletions
diff --git a/manifests/base.pp b/manifests/base.pp index 3880b2e..33acefd 100644 --- a/manifests/base.pp +++ b/manifests/base.pp @@ -6,14 +6,14 @@ class lighttpd::base { service{lighttpd: ensure => running, enable => true, - hasstatus => true, + hasstatus => true, require => Package[lighttpd], } file{'/etc/lighttpd/lighttpd.conf': - source => [ "puppet:///modules/site-lighttpd/${fqdn}/lighttpd.conf", - "puppet:///modules/site-lighttpd/lighttpd.conf", - "puppet:///modules/lighttpd/${operatingsystem}/lighttpd.conf", + source => [ "puppet:///modules/site_lighttpd/${::fqdn}/lighttpd.conf", + "puppet:///modules/site_lighttpd/lighttpd.conf", + "puppet:///modules/lighttpd/${::operatingsystem}/lighttpd.conf", "puppet:///modules/lighttpd/lighttpd.conf" ], require => Package['lighttpd'], notify => Service['lighttpd'], diff --git a/manifests/config/file.pp b/manifests/config/file.pp index 7d44780..c703834 100644 --- a/manifests/config/file.pp +++ b/manifests/config/file.pp @@ -3,7 +3,7 @@ define lighttpd::config::file( $conf_source = 'absent', $content = 'absent' ){ - $conf_dir = $operatingsystem ? { + $conf_dir = $::operatingsystem ? { debian => '/etc/lighttpd/conf-available', ubuntu => '/etc/lighttpd/conf-available', default => '/etc/lighttpd/conf.d' @@ -19,15 +19,15 @@ define lighttpd::config::file( File["${conf_dir}/${name}.conf"]{ source => $conf_source ? { 'absent' => [ - "puppet:///modules/site-lighttpd/conf.d/$fqdn/$name.conf", - "puppet:///modules/site-lighttpd/conf.d/$lighttpd_cluster_node/$name.conf", - "puppet:///modules/site-lighttpd/conf.d/$operatingsystem.$lsbdistcodename/$name.conf", - "puppet:///modules/site-lighttpd/conf.d/$operatingsystem/$name.conf", - "puppet:///modules/site-lighttpd/conf.d/$name.conf", - "puppet:///modules/lighttpd/conf.d/$name.conf", - "puppet:///modules/lighttpd/conf.d/$operatingsystem.$lsbdistcodename/$name.conf", - "puppet:///modules/lighttpd/conf.d/$operatingsystem/$name.conf", - "puppet:///modules/lighttpd/conf.d/$name.conf" + "puppet:///modules/site_lighttpd/conf.d/${::fqdn}/${name}.conf", + "puppet:///modules/site_lighttpd/conf.d/${lighttpd::cluster_node}/${name}.conf", + "puppet:///modules/site_lighttpd/conf.d/${::operatingsystem}.${::lsbdistcodename}/${name}.conf", + "puppet:///modules/site_lighttpd/conf.d/${::operatingsystem}/${name}.conf", + "puppet:///modules/site_lighttpd/conf.d/${name}.conf", + "puppet:///modules/lighttpd/conf.d/${name}.conf", + "puppet:///modules/lighttpd/conf.d/${::operatingsystem}.${::lsbdistcodename}/${name}.conf", + "puppet:///modules/lighttpd/conf.d/${::operatingsystem}/${name}.conf", + "puppet:///modules/lighttpd/conf.d/${name}.conf" ], default => "puppet:///$conf_source", } diff --git a/manifests/init.pp b/manifests/init.pp index 9ec22fb..d8fd745 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -2,17 +2,19 @@ # Copyright (C) 2007 admin@immerda.ch # GPLv3 -class lighttpd { - case $operatingsystem { +class lighttpd( + $cluster_node = hiera('lighttpd_cluster_node','some_cluster_node') +) { + case $::operatingsystem { debian,ubuntu: { include lighttpd::debian } centos,redhat,fedora: { include lighttpd::centos } default: { include lighttpd::base } } - if $use_shorewall { + if hiera('use_shorewall',false) { include shorewall::rules::http } - if $use_munin { + if hiera('use_munin',false) { include lighttpd::munin } } diff --git a/manifests/ssl.pp b/manifests/ssl.pp index efa677e..deb464c 100644 --- a/manifests/ssl.pp +++ b/manifests/ssl.pp @@ -1,6 +1,6 @@ class lighttpd::ssl inherits lighttpd { lighttpd::config::file{ 'ssl': } - if $use_shorewall { + if hiera('use_shorewall',false) { include shorewall::rules::https } } diff --git a/manifests/vhost/file.pp b/manifests/vhost/file.pp index 054a530..c3f82c1 100644 --- a/manifests/vhost/file.pp +++ b/manifests/vhost/file.pp @@ -3,35 +3,32 @@ define lighttpd::vhost::file( $vhost_source = 'absent', $content = 'absent' ){ - include ::lighttpd::vhosts - file{"/etc/lighttpd/vhosts.d/${name}.conf": - ensure => $ensure, - notify => Service['lighttpd'], - owner => root, group => 0, mode => 0644; - } + include ::lighttpd::vhosts + file{"/etc/lighttpd/vhosts.d/${name}.conf": + ensure => $ensure, + notify => Service['lighttpd'], + owner => root, group => 0, mode => 0644; + } - case $content { - 'absent': { - File["/etc/lighttpd/vhosts.d/${name}.conf"]{ - source => $vhost_source ? { - 'absent' => [ - "puppet:///modules/site-lighttpd/vhosts.d/$fqdn/$name.conf", - "puppet:///modules/site-lighttpd/vhosts.d/$lighttpd_cluster_node/$name.conf", - "puppet:///modules/site-lighttpd/vhosts.d/$operatingsystem.$lsbdistcodename/$name.conf", - "puppet:///modules/site-lighttpd/vhosts.d/$operatingsystem/$name.conf", - "puppet:///modules/site-lighttpd/vhosts.d/$name.conf", - "puppet:///modules/lighttpd/vhosts.d/$operatingsystem.$lsbdistcodename/$name.conf", - "puppet:///modules/lighttpd/vhosts.d/$operatingsystem/$name.conf", - "puppet:///modules/lighttpd/vhosts.d/$name.conf" - ], - default => "puppet:///$vhost_source", - } - } - } - default: { - File["/etc/lighttpd/vhosts.d/${name}.conf"]{ - content => $content, - } + case $content { + 'absent': { + File["/etc/lighttpd/vhosts.d/${name}.conf"]{ + source => $vhost_source ? { + 'absent' => [ + "puppet:///modules/site_lighttpd/vhosts.d/${::fqdn}/${name}.conf", + "puppet:///modules/site_lighttpd/vhosts.d/${lighttpd::cluster_node}/${name}.conf", + "puppet:///modules/site_lighttpd/vhosts.d/${::operatingsystem}.${::lsbdistcodename}/${name}.conf", + "puppet:///modules/site_lighttpd/vhosts.d/${::operatingsystem}/${name}.conf", + "puppet:///modules/site_lighttpd/vhosts.d/${name}.conf" + ], + default => "puppet:///${vhost_source}", } + } + } + default: { + File["/etc/lighttpd/vhosts.d/${name}.conf"]{ + content => $content, + } } + } } |