From 2c16c4788cc352a79c548fd9164d65264ae55d22 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sat, 19 Jan 2013 16:04:58 -0200 Subject: Upgrading for 2.7 compatibility --- manifests/site.pp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'manifests/site.pp') diff --git a/manifests/site.pp b/manifests/site.pp index 0c68361..d5046da 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -109,25 +109,25 @@ define apache::site($ensure = present, $docroot = false, $redirect = false, case $source { true: { - file { "${apache2_sites}-available/$vhost": + file { "${apache::sites}-available/$vhost": ensure => $ensure, source => [ "puppet:///modules/site-apache/vhosts/$domain/$title", "puppet:///modules/site-apache/vhosts/$title" ], owner => root, group => root, mode => 0644, - require => File["${apache2_macros}"], + require => File["${apache::macros}"], notify => Service["apache"], } } false: { - file { "${apache2_sites}-available/$vhost": + file { "${apache::sites}-available/$vhost": ensure => $ensure, content => template("$template"), owner => root, group => root, mode => 0644, - require => File["${apache2_macros}"], + require => File["${apache::macros}"], notify => Service["apache"], } } @@ -136,7 +136,7 @@ define apache::site($ensure = present, $docroot = false, $redirect = false, # Enable the site without a2ensite # #$status = $ensure ? { - # 'present' => "${apache2_sites}-available/$vhost", + # 'present' => "${apache::sites}-available/$vhost", # default => 'absent', #} # @@ -144,7 +144,7 @@ define apache::site($ensure = present, $docroot = false, $redirect = false, # ensure => $status, # owner => root, # group => root, - # require => File["${apache2_sites}-available/$title"], + # require => File["${apache::sites}-available/$title"], # notify => Service["apache"], #} @@ -171,19 +171,19 @@ define apache::site($ensure = present, $docroot = false, $redirect = false, } } exec { "/usr/sbin/a2ensite $vhost": - unless => "/bin/sh -c '[ -L ${apache2_sites}-enabled/$vhost ] \ - && [ ${apache2_sites}-enabled/$vhost -ef ${apache2_sites}-available/$vhost ]'", + unless => "/bin/sh -c '[ -L ${apache::sites}-enabled/$vhost ] \ + && [ ${apache::sites}-enabled/$vhost -ef ${apache::sites}-available/$vhost ]'", notify => Exec["reload-apache2"], } } 'absent': { exec { "/usr/sbin/a2dissite $vhost": - onlyif => "/bin/sh -c '[ -L ${apache2_sites}-enabled/$vhost ] \ - && [ ${apache2_sites}-enabled/$vhost -ef ${apache2_sites}-available/$vhost ]'", + onlyif => "/bin/sh -c '[ -L ${apache::sites}-enabled/$vhost ] \ + && [ ${apache::sites}-enabled/$vhost -ef ${apache::sites}-available/$vhost ]'", notify => Exec["reload-apache2"], } - file { "${apache2_sites}-enabled/$vhost": + file { "${apache::sites}-enabled/$vhost": ensure => absent, notify => Exec["reload-apache2"], } -- cgit v1.2.3