X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fapache2%2Fmanifests%2Fsite.pp;h=dc9b1ced1f796f00d6e547e391673275f11d43fe;hb=4f011cbc16fddc4f475bf40ae11e3407bd4ac1dc;hp=7acbfc6495509bb046868f904f2844b9da36a3d3;hpb=3395dcb371c4b2200f14dfc3106b17d2957de3b9;p=mirror%2Fdsa-puppet.git diff --git a/modules/apache2/manifests/site.pp b/modules/apache2/manifests/site.pp index 7acbfc649..dc9b1ced1 100644 --- a/modules/apache2/manifests/site.pp +++ b/modules/apache2/manifests/site.pp @@ -1,6 +1,6 @@ define apache2::site ( $source=undef, - $content=false, + $content=undef, $ensure=present, $site=undef ) { @@ -27,8 +27,7 @@ define apache2::site ( $link_target = $ensure ? { present => $target, - absent => absent, - default => fail ( "Unknown ensure value: '$ensure'" ), + absent => absent } if $content { @@ -36,27 +35,34 @@ define apache2::site ( ensure => $ensure, content => $content, require => Package['apache2'], - notify => Service['apache2'], + notify => Exec['service apache2 reload'], } } else { file { $target: ensure => $ensure, source => $source, require => Package['apache2'], - notify => Service['apache2'], + notify => Exec['service apache2 reload'], } } + $symlink = "/etc/apache2/sites-enabled/${name}.conf" + + file { "/etc/apache2/sites-enabled/${name}": + ensure => absent, + notify => Exec['service apache2 reload'], + } + if $ensure == present { - file { "/etc/apache2/sites-enabled/${name}": + file { $symlink: ensure => link, target => $link_target, - notify => Service['apache2'], + notify => Exec['service apache2 reload'], } } else { - file { "/etc/apache2/sites-enabled/${name}": + file { $symlink: ensure => absent, - notify => Service['apache2'], + notify => Exec['service apache2 reload'], } } }