diff options
Diffstat (limited to 'manifests/config/file.pp')
-rw-r--r-- | manifests/config/file.pp | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/manifests/config/file.pp b/manifests/config/file.pp index e04b631..308da68 100644 --- a/manifests/config/file.pp +++ b/manifests/config/file.pp @@ -14,7 +14,7 @@ define apache::config::file( default: { fail("Wrong config file type specified for ${name}") } } $real_destination = $destination ? { - 'absent' => $operatingsystem ? { + 'absent' => $::operatingsystem ? { centos => "${apache::centos::config_dir}/${confdir}/${name}", gentoo => "${apache::gentoo::config_dir}/${name}", debian => "${apache::debian::config_dir}/${confdir}/${name}", @@ -30,16 +30,24 @@ define apache::config::file( notify => Service[apache], owner => root, group => 0, mode => 0644; } - - case $ensure { - 'absent','purged': { - # We want to avoid all stuff related to source and content - } - 'link': { - if $target != false { - File["apache_${name}"] { - target => $target, - } + if $ensure == 'present' { + 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 + } + File["apache_${name}"]{ + source => $real_source, } } default: { @@ -69,10 +77,11 @@ define apache::config::file( } } } + } } - case $operatingsystem { - openbsd: { info("no package dependency on ${operatingsystem} for ${name}") } + case $::operatingsystem { + openbsd: { info("no package dependency on ${::operatingsystem} for ${name}") } default: { File["apache_${name}"]{ require => Package[apache], |