Skip to content

Commit

Permalink
Merge branch 'master' of github.com:/example42/puppet-tp
Browse files Browse the repository at this point in the history
  • Loading branch information
alvagante committed Mar 2, 2020
2 parents 86c3fd6 + cacc4ed commit a5e23ed
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
1 change: 0 additions & 1 deletion functions/ensure2dir.pp
@@ -1,6 +1,5 @@
function tp::ensure2dir (
Variant[Boolean,String] $input = present,
$default = undef,
) {

$output = $input ? {
Expand Down
11 changes: 11 additions & 0 deletions functions/ensure2file.pp
@@ -0,0 +1,11 @@
function tp::ensure2file (
Variant[Boolean,String] $input = present,
) {

$output = $input ? {
'absent' => absent,
false => absent,
default => present,
}

}
4 changes: 2 additions & 2 deletions manifests/install.pp
Expand Up @@ -291,7 +291,7 @@

# Manage additional tp::conf as in conf_hash
$conf_defaults = {
'ensure' => $ensure,
'ensure' => tp::ensure2file($ensure),
'settings_hash' => $settings,
'options_hash' => $options_hash,
}
Expand All @@ -305,7 +305,7 @@

# Manage additional tp::dir as in dir_hash
$dir_defaults = {
'ensure' => $ensure,
'ensure' => tp::ensure2dir($ensure),
'settings_hash' => $settings,
}
if $dir_hash != {} {
Expand Down

0 comments on commit a5e23ed

Please sign in to comment.