aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2013-01-21 19:08:06 -0200
committerSilvio Rhatto <rhatto@riseup.net>2013-01-21 19:08:06 -0200
commit56bac37c3343cd3151c289088ab578d21402a455 (patch)
tree80d49b038a99b0253aa0dabd5b1f10a9ad2a85eb
parent7cc8c05c571d18b9a39eb5643dd9af26d31005ff (diff)
downloadpuppet-postfix-56bac37c3343cd3151c289088ab578d21402a455.tar.gz
puppet-postfix-56bac37c3343cd3151c289088ab578d21402a455.tar.bz2
Updating header_checks_snippet to use concat
-rw-r--r--manifests/header_checks_snippet.pp21
1 files changed, 7 insertions, 14 deletions
diff --git a/manifests/header_checks_snippet.pp b/manifests/header_checks_snippet.pp
index 454d219..91d7501 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 {
+ postfix::header_checks_snippet {
'wrong_date': content => 'FIXME';
'bla': source => 'puppet:///files/etc/postfix/header_checks.d/bla';
}
@@ -37,29 +37,22 @@ define postfix::header_checks_snippet (
fail("Only one of \$source or \$content must specified for postfix::header_checks_snippet ${name}")
}
- if ($value == false) and ($ensure == "present") {
- fail("The value parameter must be set when using the postfix::header_checks_snippet define with ensure=present.")
- }
-
include postfix::header_checks
- $snippetfile = "${postfix::header_checks::postfix_header_checks_snippets_dir}/${name}"
-
- file { "$snippetfile":
+ $fragment = "postfix_header_checks_${name}"
+
+ concat::fragment { "$fragment":
ensure => "$ensure",
- mode => 600,
- owner => root,
- group => 0,
- notify => Exec["concat_${postfix::header_checks::postfix_merged_header_checks}"],
+ target => '/etc/postfix/header_checks',
}
if $source {
- File["$snippetfile"] {
+ Concat::Fragment["$fragment"] {
source => $source,
}
}
else {
- File["$snippetfile"] {
+ Concat::Fragment["$fragment"] {
content => $content,
}
}