From 6138c73f0cbaddc0049f217f3f84cf4dcc3d2029 Mon Sep 17 00:00:00 2001 From: mh Date: Sat, 16 Oct 2010 17:30:07 +0200 Subject: debinize config --- manifests/base.pp | 1 + manifests/config/file.pp | 11 ++++++++--- manifests/debian.pp | 8 ++++++++ manifests/init.pp | 1 + 4 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 manifests/debian.pp (limited to 'manifests') diff --git a/manifests/base.pp b/manifests/base.pp index 84062eb..41af569 100644 --- a/manifests/base.pp +++ b/manifests/base.pp @@ -13,6 +13,7 @@ class lighttpd::base { 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" ], "puppet:///modules/lighttpd/lighttpd.conf" ], require => Package['lighttpd'], notify => Service['lighttpd'], diff --git a/manifests/config/file.pp b/manifests/config/file.pp index 8993693..7d44780 100644 --- a/manifests/config/file.pp +++ b/manifests/config/file.pp @@ -3,7 +3,12 @@ define lighttpd::config::file( $conf_source = 'absent', $content = 'absent' ){ - file{"/etc/lighttpd/conf.d/${name}.conf": + $conf_dir = $operatingsystem ? { + debian => '/etc/lighttpd/conf-available', + ubuntu => '/etc/lighttpd/conf-available', + default => '/etc/lighttpd/conf.d' + } + file{"${conf_dir}/${name}.conf": ensure => $ensure, notify => Service['lighttpd'], owner => root, group => 0, mode => 0644; @@ -11,7 +16,7 @@ define lighttpd::config::file( case $content { 'absent': { - File["/etc/lighttpd/conf.d/${name}.conf"]{ + File["${conf_dir}/${name}.conf"]{ source => $conf_source ? { 'absent' => [ "puppet:///modules/site-lighttpd/conf.d/$fqdn/$name.conf", @@ -29,7 +34,7 @@ define lighttpd::config::file( } } default: { - File["/etc/lighttpd/conf.d/${name}.conf"]{ + File["${conf_dir}/${name}.conf"]{ content => $content, } } diff --git a/manifests/debian.pp b/manifests/debian.pp new file mode 100644 index 0000000..0b67924 --- /dev/null +++ b/manifests/debian.pp @@ -0,0 +1,8 @@ +class lighttpd::debian inherits lighttpd::base { + file{ + '/var/www/lighttpd': + ensure => directory; + '/var/www/index.lighttpd.html': + ensure => absent, + } +} diff --git a/manifests/init.pp b/manifests/init.pp index 11078aa..9772817 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -4,6 +4,7 @@ class lighttpd { case $operatingsystem { + debian,ubuntu: { include lighttpd::debian } default: { include lighttpd::base } } -- cgit v1.2.3