apache2::site { '00-default':
site => 'default-debian.org',
- template => 'apache2/default-debian.org.erb',
+ content => template('apache2/default-debian.org.erb'),
}
apache2::site { '000-default':
define apache2::site (
- $config = undef,
- $template = false,
- $ensure = present,
- $site = undef
+ $source=undef,
+ $content=false,
+ $ensure=present,
+ $site=undef
) {
include apache2
- if $ensure == present {
- if ! ($config or $template) {
- fail ( "No configuration found for ${name}" )
+ case $ensure {
+ present: {
+ if ! ($source or $content) {
+ fail ( "No configuration found for ${name}" )
+ }
}
+ absent: {}
+ default: { fail ( "Unknown ensure value: '$ensure'" ) }
}
if $site {
default => fail ( "Unknown ensure value: '$ensure'" ),
}
- case $template {
- false: {
- file { $target:
- ensure => $ensure,
- source => $config,
- require => Package['apache2'],
- notify => Service['apache2'],
- }
+ if $content {
+ file { $target:
+ ensure => $ensure,
+ content => $content,
+ require => Package['apache2'],
+ notify => Service['apache2'],
}
- default: {
- file { $target:
- ensure => $ensure,
- content => template($template),
- require => Package['apache2'],
- notify => Service['apache2'],
- }
+ } else {
+ file { $target:
+ ensure => $ensure,
+ source => $source,
+ require => Package['apache2'],
+ notify => Service['apache2'],
}
}
class roles::backports_mirror {
apache2::site { '010-backports.debian.org':
site => 'backports.debian.org',
- config => 'puppet:///modules/roles/backports_mirror/backports.debian.org',
+ source => 'puppet:///modules/roles/backports_mirror/backports.debian.org',
}
apache2::site { '010-www.backports.org':
site => 'www.backports.org',
- config => 'puppet:///modules/roles/backports_mirror/www.backports.org',
+ source => 'puppet:///modules/roles/backports_mirror/www.backports.org',
}
apache2::module { 'rewrite': }
apache2::site { '010-ftp-upcoming.debian.org':
site => 'ftp-upcoming.debian.org',
- config => 'puppet:///modules/roles/ftp-upcoming_mirror/ftp-upcoming.debian.org',
+ source => 'puppet:///modules/roles/ftp-upcoming_mirror/ftp-upcoming.debian.org',
}
}
apache2::site { '010-security.debian.org':
site => 'security.debian.org',
- config => 'puppet:///modules/roles/security_mirror/security.debian.org'
+ source => 'puppet:///modules/roles/security_mirror/security.debian.org'
}
vsftpd::site { 'security':
apache2::site { '010-www.debian.org':
site => 'www.debian.org',
- config => 'puppet:///modules/roles/www_mirror/www.debian.org',
+ source => 'puppet:///modules/roles/www_mirror/www.debian.org',
}
}