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'],
$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'
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",
}
# 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
}
}
class lighttpd::ssl inherits lighttpd {
lighttpd::config::file{ 'ssl': }
- if $use_shorewall {
+ if hiera('use_shorewall',false) {
include shorewall::rules::https
}
}
$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,
+ }
}
+ }
}
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
- <title><%= hostname %></title>
+ <title><%= scope.lookupvar('::hostname') %></title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>
<body>
alt="Valid XHTML 1.0 Strict" height="31" width="88" style="border: 0;" /></a>
</p>
<p>
- <small><em><%= hostname %></em></small>
+ <small><em><%= scope.lookupvar('::hostname') %></em></small>
</p>
</body>
</html>