aboutsummaryrefslogtreecommitdiff
path: root/manifests/header_checks.pp
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2013-01-21 18:25:46 -0200
committerSilvio Rhatto <rhatto@riseup.net>2013-01-21 18:25:46 -0200
commit7cc8c05c571d18b9a39eb5643dd9af26d31005ff (patch)
tree00932722b7f819681d69777d97f20d8e27cd7b22 /manifests/header_checks.pp
parent74b5b00bbd18c1ead3a6425530666817e50ffb96 (diff)
parent881a59ac62684028a7f4cb358e3592efc3ae99a9 (diff)
downloadpuppet-postfix-7cc8c05c571d18b9a39eb5643dd9af26d31005ff.tar.gz
puppet-postfix-7cc8c05c571d18b9a39eb5643dd9af26d31005ff.tar.bz2
Merge branch 'master' of ssh://labs.riseup.net/shared-postfix
Conflicts: manifests/definitions/header_checks_snippet.pp manifests/header_checks.pp manifests/header_checks_snippet.pp manifests/init.pp manifests/tlspolicy.pp manifests/virtual_regexp_snippet.pp
Diffstat (limited to 'manifests/header_checks.pp')
-rw-r--r--manifests/header_checks.pp61
1 files changed, 18 insertions, 43 deletions
diff --git a/manifests/header_checks.pp b/manifests/header_checks.pp
index 071f6b0..5b0c3c8 100644
--- a/manifests/header_checks.pp
+++ b/manifests/header_checks.pp
@@ -1,57 +1,32 @@
#
# == Class: postfix::header_checks
#
-# Manages Postfix header_checks by merging snippets shipped:
-# - in the module's files/header_checks.d/ or puppet:///files/etc/postfix/header_checks.d
-# (the latter takes precedence if present); site-postfix module is supported
-# as well, see the source argument of file {"$postfix_header_checks_snippets_dir"
-# bellow for details.
-# - via postfix::header_checks_snippet defines
+# Manages Postfix header_checks by merging snippets configured
+# via postfix::header_checks_snippet defines
#
-# Example usage:
-#
-# node "toto.example.com" {
-# $postfix_manage_header_checks = yes
-# include postfix
-# }
+# Note that this class is useless when used directly.
+# The postfix::header_checks_snippet defines takes care of importing
+# it anyway.
#
class postfix::header_checks {
- include common::moduledir
- module_dir{'postfix/header_checks': }
-
- $postfix_header_checks_dir = "${common::moduledir::module_dir_path}/postfix/header_checks"
- $postfix_header_checks_snippets_dir = "${postfix_header_checks_dir}/header_checks.d"
- $postfix_merged_header_checks = "${postfix_header_checks_dir}/merged_header_checks"
-
- file {"$postfix_header_checks_snippets_dir":
- ensure => 'directory',
- owner => 'root',
- group => '0',
- mode => '700',
- source => [
- "puppet:///modules/site-postfix/${fqdn}/header_checks.d",
- "puppet:///modules/site-postfix/header_checks.d",
- "puppet:///files/etc/postfix/header_checks.d",
- "puppet:///modules/postfix/header_checks.d",
- ],
- recurse => true,
- purge => false,
- }
-
- concatenated_file { "$postfix_merged_header_checks":
- dir => "${postfix_header_checks_snippets_dir}",
- require => File["$postfix_header_checks_snippets_dir"],
- }
-
- config_file { '/etc/postfix/header_checks':
- source => "$postfix_merged_header_checks",
- subscribe => File["$postfix_merged_header_checks"],
+ concat { '/etc/postfix/header_checks':
+ owner => root,
+ group => root,
+ mode => '0600',
}
postfix::config { "header_checks":
value => 'regexp:/etc/postfix/header_checks',
- require => File['/etc/postfix/header_checks'],
+ require => Concat['/etc/postfix/header_checks'],
+ }
+
+ # Cleanup previous implementation's internal files
+ include common::moduledir
+ file { "${common::moduledir::module_dir_path}/postfix/header_checks":
+ ensure => absent,
+ recurse => true,
+ force => true,
}
}