summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2009-12-25 01:16:38 -0200
committerSilvio Rhatto <rhatto@riseup.net>2009-12-25 01:16:38 -0200
commit719e96989689daa76b14296465fd9a9e33d2e008 (patch)
tree78fd54f1656f8590347e1f3b0ba0cf715185033d
parent77d098388b06d56af601ef3dbc3c0068e24adb69 (diff)
downloadpuppet-apache-719e96989689daa76b14296465fd9a9e33d2e008.tar.gz
puppet-apache-719e96989689daa76b14296465fd9a9e33d2e008.tar.bz2
Fixing conditional (2)
-rw-r--r--manifests/init.pp40
1 files changed, 21 insertions, 19 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index cf67556..505a134 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -87,26 +87,28 @@ class apache {
$server_alias = false, $use = false, $ticket = false,
$source = false) {
- if $source != false {
- file { "${apache2_sites}-available/$title":
- ensure => $ensure,
- source => $source,
- owner => root,
- group => root,
- mode => 0644,
- require => File["${apache2_macros}"],
- notify => Service["apache"],
- }
- } else {
- file { "${apache2_sites}-available/$title":
- ensure => $ensure,
- content => template('apache/site.erb'),
- owner => root,
- group => root,
- mode => 0644,
- require => File["${apache2_macros}"],
- notify => Service["apache"],
+ case $source {
+ false: {
+ file { "${apache2_sites}-available/$title":
+ ensure => $ensure,
+ source => $source,
+ owner => root,
+ group => root,
+ mode => 0644,
+ require => File["${apache2_macros}"],
+ notify => Service["apache"],
+ }
}
+ default:
+ file { "${apache2_sites}-available/$title":
+ ensure => $ensure,
+ content => template('apache/site.erb'),
+ owner => root,
+ group => root,
+ mode => 0644,
+ require => File["${apache2_macros}"],
+ notify => Service["apache"],
+ }
}
$status = $ensure ? {