X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;ds=sidebyside;f=modules%2Fapache2%2Fmanifests%2Fsite.pp;h=2a7257ba76e1cd543fa65ec8e1e594539cb0cfe8;hb=14dbe81b92fcbc6ca8328d8fb39293761297b4bf;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..2a7257ba7 100644 --- a/modules/apache2/manifests/site.pp +++ b/modules/apache2/manifests/site.pp @@ -35,27 +35,38 @@ 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'], } } - if $ensure == present { + if $::lsbmajdistrelease <= 7 { + $symlink = "/etc/apache2/sites-enabled/${name}" + } else { + $symlink = "/etc/apache2/sites-enabled/${name}.conf" + file { "/etc/apache2/sites-enabled/${name}": + ensure => absent, + notify => Exec['service apache2 reload'], + } + } + + if $ensure == present { + 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'], } } }