X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fapache2%2Fmanifests%2Fsite.pp;h=dc9b1ced1f796f00d6e547e391673275f11d43fe;hb=b35029960fcfa6a60da9624bf33b3e90dbe29144;hp=4588a60242e707202e15557c8fd5d1aef55a89bf;hpb=be87d13ce2fbaf73cf58cd9955f39f51aabdb773;p=mirror%2Fdsa-puppet.git diff --git a/modules/apache2/manifests/site.pp b/modules/apache2/manifests/site.pp index 4588a6024..dc9b1ced1 100644 --- a/modules/apache2/manifests/site.pp +++ b/modules/apache2/manifests/site.pp @@ -35,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'], } } }