summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2009-12-26 17:28:32 -0200
committerSilvio Rhatto <rhatto@riseup.net>2009-12-26 17:28:32 -0200
commitc6d0999167bac7a76c51985fcc6514404dfadd8a (patch)
treea4e3af03c072922e6fe728ad573d71a7742f6f43
parent608a27facad552f5545b2806bf970ddc8b1b78c1 (diff)
downloadpuppet-apache-c6d0999167bac7a76c51985fcc6514404dfadd8a.tar.gz
puppet-apache-c6d0999167bac7a76c51985fcc6514404dfadd8a.tar.bz2
Using true/false for source
-rw-r--r--manifests/init.pp26
1 files changed, 13 insertions, 13 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index 70f6cc2..2167bbb 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -85,10 +85,21 @@ class apache {
define site($ensure = present, $docroot = false, $redirect = false,
$redirect_match = false, $protocol = 'http',
$server_alias = false, $use = false, $ticket = false,
- $source = '') {
+ $source = false) {
case $source {
- '': {
+ true: {
+ file { "${apache2_sites}-available/$title":
+ ensure => $ensure,
+ source => "puppet://$server/files/apache/$name",
+ owner => root,
+ group => root,
+ mode => 0644,
+ require => File["${apache2_macros}"],
+ notify => Service["apache"],
+ }
+ }
+ false: {
file { "${apache2_sites}-available/$title":
ensure => $ensure,
content => template('apache/site.erb'),
@@ -99,17 +110,6 @@ class apache {
notify => Service["apache"],
}
}
- default: {
- file { "${apache2_sites}-available/$title":
- ensure => $ensure,
- source => $source,
- owner => root,
- group => root,
- mode => 0644,
- require => File["${apache2_macros}"],
- notify => Service["apache"],
- }
- }
}
$status = $ensure ? {