diff options
-rw-r--r-- | manifests/site.pp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/manifests/site.pp b/manifests/site.pp index 00d6f3c..f6cfef3 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -150,11 +150,11 @@ define apache::site( # Enable the site without a2ensite # #$status = $ensure ? { - # 'present' => "${apache::sites}-available/$vhost", + # 'present' => "${apache::sites}-available/$vhost.conf", # default => 'absent', #} # - #file { "/etc/apache2/sites-enabled/$title": + #file { "/etc/apache2/sites-enabled/$vhost.conf": # ensure => $status, # owner => root, # group => root, @@ -185,6 +185,10 @@ define apache::site( } } exec { "/usr/sbin/a2ensite $vhost": + command => $::lsbdistcodename ? { + 'wheezy' => "/usr/sbin/a2ensite $vhost.conf", + default => "/usr/sbin/a2ensite $vhost", + }, unless => "/bin/sh -c '[ -L ${apache::sites}-enabled/$vhost.conf ] \ && [ ${apache::sites}-enabled/$vhost.conf -ef ${apache::sites}-available/$vhost.conf ]'", notify => Exec["reload-apache2"], @@ -192,6 +196,10 @@ define apache::site( } 'absent': { exec { "/usr/sbin/a2dissite $vhost": + command => $::lsbdistcodename ? { + 'wheezy' => "/usr/sbin/a2dissite $vhost.conf", + default => "/usr/sbin/a2dissite $vhost", + }, onlyif => "/bin/sh -c '[ -L ${apache::sites}-enabled/$vhost.conf ] \ && [ ${apache::sites}-enabled/$vhost.conf -ef ${apache::sites}-available/$vhost.conf ]'", notify => Exec["reload-apache2"], |