Skip to content

Commit

Permalink
Merge pull request #868 from puppetlabs/revert-789-init-var-cleanup
Browse files Browse the repository at this point in the history
Revert "Remove deprecated purge_vdir; Rename variables"
  • Loading branch information
hunner committed Sep 26, 2014
2 parents 247b802 + cf9d120 commit d81a202
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
$service_ensure = 'running',
$purge_configs = true,
$purge_vhost_dir = undef,
$purge_vdir = false,
$serveradmin = 'root@localhost',
$sendfile = 'On',
$error_documents = false,
Expand Down Expand Up @@ -121,11 +122,19 @@
service_ensure => $service_ensure,
}

# Deprecated backwards-compatibility
if $purge_vdir {
warning('Class[\'apache\'] parameter purge_vdir is deprecated in favor of purge_configs')
$purge_confd = $purge_vdir
} else {
$purge_confd = $purge_configs
}

# Set purge vhostd appropriately
if $purge_vhost_dir == undef {
$_purge_vhost_dir = $purge_configs
$purge_vhostd = $purge_confd
} else {
$_purge_vhost_dir = $purge_vhost_dir
$purge_vhostd = $purge_vhost_dir
}

Exec {
Expand All @@ -139,7 +148,7 @@
file { $confd_dir:
ensure => directory,
recurse => true,
purge => $purge_configs,
purge => $purge_confd,
notify => Class['Apache::Service'],
require => Package['httpd'],
}
Expand Down Expand Up @@ -185,7 +194,7 @@
file { $vhost_dir:
ensure => directory,
recurse => true,
purge => $_purge_vhost_dir,
purge => $purge_vhostd,
notify => Class['Apache::Service'],
require => Package['httpd'],
}
Expand All @@ -200,7 +209,7 @@
file { $vhost_enable_dir:
ensure => directory,
recurse => true,
purge => $_purge_vhost_dir,
purge => $purge_vhostd,
notify => Class['Apache::Service'],
require => Package['httpd'],
}
Expand Down

0 comments on commit d81a202

Please sign in to comment.