diff options
author | mh <mh@immerda.ch> | 2010-07-06 00:06:32 +0200 |
---|---|---|
committer | mh <mh@immerda.ch> | 2010-07-06 00:08:56 +0200 |
commit | 29deff66d7dfad609e429a14ad6917b79de5de50 (patch) | |
tree | a1b8a526c5e07e95be8ff6451216a5269b606f66 /manifests/vhost/file.pp | |
parent | 9ff20635fbb0945195f2b562f46efca8f5d13850 (diff) | |
download | puppet-lighttpd-29deff66d7dfad609e429a14ad6917b79de5de50.tar.gz puppet-lighttpd-29deff66d7dfad609e429a14ad6917b79de5de50.tar.bz2 |
improve vhosts / ssl stuff
- facter out ssl things in a seperate file
- introduce 1 vhost per file config
Diffstat (limited to 'manifests/vhost/file.pp')
-rw-r--r-- | manifests/vhost/file.pp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/manifests/vhost/file.pp b/manifests/vhost/file.pp new file mode 100644 index 0000000..f047173 --- /dev/null +++ b/manifests/vhost/file.pp @@ -0,0 +1,37 @@ +define lighttpd::vhost::file( + $ensure = present, + $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; + } + + case $content { + 'absent': { + File["/etc/lighttpd/vhosts.d/${name}.conf"]{ + source => $vhost_source ? { + 'absent' => [ + "puppet://$server/modules/site-lighttpd/vhosts.d/$fqdn/$name.conf", + "puppet://$server/modules/site-lighttpd/vhosts.d/$lighttpd_cluster_node/$name.conf", + "puppet://$server/modules/site-lighttpd/vhosts.d/$operatingsystem.$lsbdistcodename/$name.conf", + "puppet://$server/modules/site-lighttpd/vhosts.d/$operatingsystem/$name.conf", + "puppet://$server/modules/site-lighttpd/vhosts.d/$name.conf", + "puppet://$server/modules/lighttpd/vhosts.d/$operatingsystem.$lsbdistcodename/$name.conf", + "puppet://$server/modules/lighttpd/vhosts.d/$operatingsystem/$name.conf", + "puppet://$server/modules/lighttpd/vhosts.d/$name.conf" + ], + default => "puppet://$server/$vhost_source", + } + } + } + default: { + File["/etc/lighttpd/vhosts.d/${name}.conf"]{ + content => $content, + } + } + } +} |