Skip to content

Commit

Permalink
fix bug when disabling package handling
Browse files Browse the repository at this point in the history
  • Loading branch information
theosotr committed Feb 13, 2019
1 parent 32f3a0f commit df870bd
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
Boolean $test_before_deploy = true
) {
# package
$require_package = undef
if $manage_package {
if is_string($package_name) {
$real_package_name = $package_name
Expand All @@ -20,6 +21,7 @@
default: { fail("unsupported osfamily: ${::osfamily}") }
}
}
$require_package = Package[$real_package_name]
ensure_resource ( 'package', $real_package_name, { 'ensure' => 'installed' })
}
ensure_resource ( 'file', $temp_dir, { ensure => directory } )
Expand All @@ -32,14 +34,14 @@
'file', "${base_dir}/etc/syslog-ng",
{
ensure => 'directory',
require => Package[$real_package_name],
require => $require_package,
}
)
ensure_resource (
'file', "${base_dir}/var/lib/syslog-ng",
{
ensure => 'directory',
require => Package[$real_package_name],
require => $require_package,
}
)
ensure_resource (
Expand All @@ -48,7 +50,7 @@
ensure => 'directory',
purge => true,
recurse => true,
require => Package[$real_package_name],
require => $require_package,
}
)
$pdb_dir = "${base_dir}/etc/syslog-ng/patterndb.d"
Expand All @@ -57,7 +59,7 @@
purge => true,
recurse => true,
source => 'puppet:///modules/patterndb/patterndb.d',
require => Package[$real_package_name],
require => $require_package,
}

if $use_hiera {
Expand Down

0 comments on commit df870bd

Please sign in to comment.