diff options
Diffstat (limited to 'manifests/header_checks_snippet.pp')
-rw-r--r-- | manifests/header_checks_snippet.pp | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/manifests/header_checks_snippet.pp b/manifests/header_checks_snippet.pp index 91d7501..454d219 100644 --- a/manifests/header_checks_snippet.pp +++ b/manifests/header_checks_snippet.pp @@ -15,7 +15,7 @@ Example usage: node "toto.example.com" { include postfix - postfix::header_checks_snippet { + postfix::header_checks { 'wrong_date': content => 'FIXME'; 'bla': source => 'puppet:///files/etc/postfix/header_checks.d/bla'; } @@ -37,22 +37,29 @@ define postfix::header_checks_snippet ( fail("Only one of \$source or \$content must specified for postfix::header_checks_snippet ${name}") } - include postfix::header_checks + if ($value == false) and ($ensure == "present") { + fail("The value parameter must be set when using the postfix::header_checks_snippet define with ensure=present.") + } - $fragment = "postfix_header_checks_${name}" + include postfix::header_checks - concat::fragment { "$fragment": + $snippetfile = "${postfix::header_checks::postfix_header_checks_snippets_dir}/${name}" + + file { "$snippetfile": ensure => "$ensure", - target => '/etc/postfix/header_checks', + mode => 600, + owner => root, + group => 0, + notify => Exec["concat_${postfix::header_checks::postfix_merged_header_checks}"], } if $source { - Concat::Fragment["$fragment"] { + File["$snippetfile"] { source => $source, } } else { - Concat::Fragment["$fragment"] { + File["$snippetfile"] { content => $content, } } |