From 7ce3190986cf8e5fe037a7ccd4c1076505b117f4 Mon Sep 17 00:00:00 2001 From: Micah Date: Tue, 12 Jul 2016 16:41:59 -0400 Subject: remove submodules in preparation for move to subrepos Change-Id: Ia7655153b556337f676e3d909559c4a7306bedd6 --- puppet/modules/postfix | 1 - 1 file changed, 1 deletion(-) delete mode 160000 puppet/modules/postfix (limited to 'puppet/modules/postfix/manifests/header_checks_snippet.pp') diff --git a/puppet/modules/postfix b/puppet/modules/postfix deleted file mode 160000 index cce918f7..00000000 --- a/puppet/modules/postfix +++ /dev/null @@ -1 +0,0 @@ -Subproject commit cce918f784ebf8a8875f43c79bc3a1f39ab9456b -- cgit v1.2.3 From 5247b7ccf5b5889ee16262dd976b03047e34e32c Mon Sep 17 00:00:00 2001 From: Micah Date: Tue, 12 Jul 2016 16:46:25 -0400 Subject: git subrepo clone https://leap.se/git/puppet_postfix puppet/modules/postfix subrepo: subdir: "puppet/modules/postfix" merged: "cce918f" upstream: origin: "https://leap.se/git/puppet_postfix" branch: "master" commit: "cce918f" git-subrepo: version: "0.3.0" origin: "https://github.com/ingydotnet/git-subrepo" commit: "1e79595" Change-Id: I325a79fe1780ee6a5d61959310cf8e52c9a6896f --- .../postfix/manifests/header_checks_snippet.pp | 60 ++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 puppet/modules/postfix/manifests/header_checks_snippet.pp (limited to 'puppet/modules/postfix/manifests/header_checks_snippet.pp') diff --git a/puppet/modules/postfix/manifests/header_checks_snippet.pp b/puppet/modules/postfix/manifests/header_checks_snippet.pp new file mode 100644 index 00000000..05929a33 --- /dev/null +++ b/puppet/modules/postfix/manifests/header_checks_snippet.pp @@ -0,0 +1,60 @@ +/* +== Definition: postfix::header_checks_snippet + +Adds a header_checks snippets to /etc/postfix/header_checks. +See the postfix::header_checks class for details. + +Parameters: +- *source* or *content*: source or content of the header_checks snippet +- *ensure*: present (default) or absent + +Requires: +- Class["postfix"] + +Example usage: + + node "toto.example.com" { + class { 'postfix': } + postfix::header_checks_snippet { + 'wrong_date': content => 'FIXME'; + 'bla': source => 'puppet:///files/etc/postfix/header_checks.d/bla'; + } + } + +*/ + +define postfix::header_checks_snippet ( + $ensure = "present", + $source = '', + $content = undef +) { + + if $source == '' and $content == undef { + fail("One of \$source or \$content must be specified for postfix::header_checks_snippet ${name}") + } + + if $source != '' and $content != undef { + fail("Only one of \$source or \$content must specified for postfix::header_checks_snippet ${name}") + } + + include postfix::header_checks + + $fragment = "postfix_header_checks_${name}" + + concat::fragment { "$fragment": + ensure => "$ensure", + target => '/etc/postfix/header_checks', + } + + if $source { + Concat::Fragment["$fragment"] { + source => $source, + } + } + else { + Concat::Fragment["$fragment"] { + content => $content, + } + } + +} -- cgit v1.2.3