From e26ab33e73d6957f1a5631cd4e7564a7f1849bbb Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Tue, 25 Feb 2014 10:19:37 -0500 Subject: fix merge conflict snafu introduced by: 115691c87bad3f5863f088e73603133b67c9f828 this fixes the incorrectly nested case statement, and brings back the lost 'config file as link' changes --- manifests/config/file.pp | 73 +++++++++++++++++++++--------------------------- 1 file changed, 32 insertions(+), 41 deletions(-) (limited to 'manifests') diff --git a/manifests/config/file.pp b/manifests/config/file.pp index 308da68..947ce96 100644 --- a/manifests/config/file.pp +++ b/manifests/config/file.pp @@ -30,52 +30,43 @@ define apache::config::file( notify => Service[apache], owner => root, group => 0, mode => 0644; } - if $ensure == 'present' { - case $content { - 'absent': { + + case $ensure { + 'absent', 'purged': { + # We want to avoid all stuff related to source and content + } + 'link': { + if $target != false { + File["apache_${name}"] { + target => $target, + } + } + } + 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}.${::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}.${::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, + source => $real_source, } - } - default: { - case $content { - 'absent': { - $real_source = $source ? { - 'absent' => [ - "puppet://${server}/modules/site-apache/${confdir}/${fqdn}/${name}", - "puppet://${server}/modules/site-apache/${confdir}/${apache_cluster_node}/${name}", - "puppet://${server}/modules/site-apache/${confdir}/${operatingsystem}.${lsbdistcodename}/${name}", - "puppet://${server}/modules/site-apache/${confdir}/${operatingsystem}/${name}", - "puppet://${server}/modules/site-apache/${confdir}/${name}", - "puppet://${server}/modules/apache/${confdir}/${operatingsystem}.${lsbdistcodename}/${name}", - "puppet://${server}/modules/apache/${confdir}/${operatingsystem}/${name}", - "puppet://${server}/modules/apache/${confdir}/${name}" - ], - default => $source, - } - File["apache_${name}"]{ - source => $real_source, - } - } - default: { - File["apache_${name}"]{ - content => $content, - } - } + } + default: { + File["apache_${name}"]{ + content => $content, } + } } } } -- cgit v1.2.3