summaryrefslogtreecommitdiff
path: root/manifests/config/file.pp
diff options
context:
space:
mode:
Diffstat (limited to 'manifests/config/file.pp')
-rw-r--r--manifests/config/file.pp62
1 files changed, 43 insertions, 19 deletions
diff --git a/manifests/config/file.pp b/manifests/config/file.pp
index 947ce96..74d289d 100644
--- a/manifests/config/file.pp
+++ b/manifests/config/file.pp
@@ -25,10 +25,12 @@ define apache::config::file(
default => $destination
}
file{"apache_${name}":
- ensure => $ensure,
- path => $real_destination,
- notify => Service[apache],
- owner => root, group => 0, mode => 0644;
+ ensure => $ensure,
+ path => $real_destination,
+ notify => Service[apache],
+ owner => root,
+ group => 0,
+ mode => '0644';
}
case $ensure {
@@ -46,25 +48,47 @@ define apache::config::file(
case $content {
'absent': {
$real_source = $source ? {
- 'absent' => [
- "puppet:///modules/site_apache/${confdir}/${::fqdn}/${name}",
- "puppet:///modules/site_apache/${confdir}/${apache::cluster_node}/${name}",
- "puppet:///modules/site_apache/${confdir}/${::operatingsystem}.${::lsbdistcodename}/${name}",
- "puppet:///modules/site_apache/${confdir}/${::operatingsystem}/${name}",
- "puppet:///modules/site_apache/${confdir}/${name}",
- "puppet:///modules/apache/${confdir}/${::operatingsystem}.${::lsbdistcodename}/${name}",
- "puppet:///modules/apache/${confdir}/${::operatingsystem}/${name}",
- "puppet:///modules/apache/${confdir}/${name}"
- ],
- default => $source,
+ 'absent' => [
+ "puppet:///modules/site_apache/${confdir}/${::fqdn}/${name}",
+ "puppet:///modules/site_apache/${confdir}/${apache::cluster_node}/${name}",
+ "puppet:///modules/site_apache/${confdir}/${::operatingsystem}.${::operatingsystemmajrelease}/${name}",
+ "puppet:///modules/site_apache/${confdir}/${::operatingsystem}/${name}",
+ "puppet:///modules/site_apache/${confdir}/${name}",
+ "puppet:///modules/apache/${confdir}/${::operatingsystem}.${::operatingsystemmajrelease}/${name}",
+ "puppet:///modules/apache/${confdir}/${::operatingsystem}/${name}",
+ "puppet:///modules/apache/${confdir}/${name}"
+ ],
+ default => $source
}
File["apache_${name}"]{
source => $real_source,
}
- }
- default: {
- File["apache_${name}"]{
- content => $content,
+ }
+ default: {
+ case $content {
+ 'absent': {
+ $real_source = $source ? {
+ 'absent' => [
+ "puppet:///modules/site-apache/${confdir}/${::fqdn}/${name}",
+ "puppet:///modules/site-apache/${confdir}/${apache::cluster_node}/${name}",
+ "puppet:///modules/site-apache/${confdir}/${::operatingsystem}.${::operatingsystemmajrelease}/${name}",
+ "puppet:///modules/site-apache/${confdir}/${::operatingsystem}/${name}",
+ "puppet:///modules/site-apache/${confdir}/${name}",
+ "puppet:///modules/apache/${confdir}/${::operatingsystem}.${::operatingsystemmajrelease}/${name}",
+ "puppet:///modules/apache/${confdir}/${::operatingsystem}/${name}",
+ "puppet:///modules/apache/${confdir}/${name}"
+ ],
+ default => $source,
+ }
+ File["apache_${name}"]{
+ source => $real_source,
+ }
+ }
+ default: {
+ File["apache_${name}"]{
+ content => $content,
+ }
+ }
}
}
}