diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2011-02-20 10:40:37 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2011-02-20 10:40:37 -0300 |
commit | 9c350efb31084cd0b39f52ec0d84d3b949a41f21 (patch) | |
tree | 8e8a64e8bf99a40549acff928a752f2449f9fb39 /manifests/definitions | |
parent | a5c262bbb1cfb95c5bcb7c59bccb6736dcc17214 (diff) | |
parent | d374575bfb9f6ebe55af1ffac537e7ccd0f484a9 (diff) | |
download | puppet-postfix-review.tar.gz puppet-postfix-review.tar.bz2 |
Merge branch 'master' of git://gaffer.ptitcanardnoir.org/puppet-module-postfix into reviewreview
Diffstat (limited to 'manifests/definitions')
-rw-r--r-- | manifests/definitions/config.pp | 4 | ||||
-rw-r--r-- | manifests/definitions/tlspolicy_snippet.pp | 47 |
2 files changed, 49 insertions, 2 deletions
diff --git a/manifests/definitions/config.pp b/manifests/definitions/config.pp index aaf73b5..8e203a6 100644 --- a/manifests/definitions/config.pp +++ b/manifests/definitions/config.pp @@ -34,8 +34,8 @@ define postfix::config ($ensure = present, $value, $nonstandard = false) { present: { exec {"postconf -e ${name}='${value}'": unless => $nonstandard ? { - false => "test \"x$(postconf -h ${name})\" == 'x${value}'", - true => "test \"x$(egrep '^${name} ' /etc/postfix/main.cf | cut -d= -f2 | cut -d' ' -f2)\" == 'x${value}'", + false => "test \"x$(postconf -h ${name})\" = 'x${value}'", + true => "test \"x$(egrep '^${name} ' /etc/postfix/main.cf | cut -d= -f2 | cut -d' ' -f2)\" = 'x${value}'", }, notify => Service["postfix"], require => File["/etc/postfix/main.cf"], diff --git a/manifests/definitions/tlspolicy_snippet.pp b/manifests/definitions/tlspolicy_snippet.pp new file mode 100644 index 0000000..2596dbc --- /dev/null +++ b/manifests/definitions/tlspolicy_snippet.pp @@ -0,0 +1,47 @@ +/* +== Definition: postfix::tlspolicy_snippet + +Adds a TLS policy snippets to /etc/postfix/tls_policy.d/. +See the postfix::tlspolicy class for details. + +Parameters: +- *name*: name of destination domain Postfix will lookup. See TLS_README. +- *value*: right-hand part of the tls_policy map +- *ensure*: present/absent, defaults to present. + +Requires: +- Class["postfix"] +- Class["postfix::tlspolicy"] + +Example usage: + + node "toto.example.com" { + $postfix_manage_tls_policy = yes + include postfix + postfix::tlspolicy_snippet { + 'example.com': value => 'encrypt'; + '.example.com': value => 'encrypt'; + 'nothing.com': value => 'fingerprint match=2A:FF:F0:EC:52:04:99:45:73:1B:C2:22:7F:FD:31:6B:8F:07:43:29'; + } + } + +*/ + +define postfix::tlspolicy_snippet ($ensure="present", $value = false) { + + include postfix::tlspolicy + + if ($value == false) and ($ensure == "present") { + fail("The value parameter must be set when using the postfix::tlspolicy_snippet define with ensure=present.") + } + + file { "${postfix::tlspolicy::postfix_tlspolicy_snippets_dir}/${name}": + ensure => "$ensure", + content => "${name} ${value}\n", + mode => 600, + owner => root, + group => 0, + notify => Exec["concat_${postfix::tlspolicy::postfix_merged_tlspolicy}"], + } + +} |