X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;ds=sidebyside;f=modules%2Fapache2%2Fmanifests%2Fsite.pp;h=46ec1bf756faa69e319e5a35080bfc11b9c1a5f2;hb=b78d7dde9375ba05a5adbff0c8bf26ad0778c840;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..46ec1bf75 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 { @@ -47,14 +46,25 @@ define apache2::site ( } } - 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 => Service['apache2'], + } + } + + if $ensure == present { + file { $symlink: ensure => link, target => $link_target, notify => Service['apache2'], } } else { - file { "/etc/apache2/sites-enabled/${name}": + file { $symlink: ensure => absent, notify => Service['apache2'], }