From 0e9cd07371336f5f7aa620fa7a996daeb7f79480 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sun, 2 Aug 2015 11:59:49 -0300 Subject: Fix a2ensite/a2dissite invocation on wheezy --- manifests/site.pp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'manifests') 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"], -- cgit v1.2.3