summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroot <admin@cmaisonneuve.qc.ca>2014-02-25 11:19:46 -0500
committerroot <admin@cmaisonneuve.qc.ca>2014-02-25 11:19:46 -0500
commit2f2aa65dafc57db6ab6d60db7ea18059840ad927 (patch)
tree8c68c1a36b59ba5c016d7c353c5358f650a5089d
parent588dd5342e97e5a659d76aa59aa5d913a8181368 (diff)
parent66cad4901ff44686c56b886bc988a9357a2299a3 (diff)
Merge branch 'master' of ssh://git.cmaisonneuve.qc.ca/srv/git/public/puppet/module-apache
-rw-r--r--README1
-rw-r--r--manifests/config/file.pp73
2 files changed, 32 insertions, 42 deletions
diff --git a/README b/README
index e90bdce..104bd62 100644
--- a/README
+++ b/README
@@ -166,7 +166,6 @@ apache::vhost { "$domain":
vhost_source => 'modules/site_configs/vhosts.d/${name}.conf"
}
-
There are multiple other additional configurables that you can pass to each
vhost definition:
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,
}
+ }
}
}
}