From 3b8ef235fa00291e5d7f2be7512a55b3fbd3693d Mon Sep 17 00:00:00 2001 From: Marc Fournier Date: Tue, 9 Feb 2010 21:50:59 +0100 Subject: postfix: added support for CentOS and Ubuntu Based on a suggestion and patch from Nick Anderson. Thanks ! --- manifests/definitions/hash.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'manifests/definitions') diff --git a/manifests/definitions/hash.pp b/manifests/definitions/hash.pp index a0514ee..3f605f0 100644 --- a/manifests/definitions/hash.pp +++ b/manifests/definitions/hash.pp @@ -34,7 +34,7 @@ define postfix::hash ($ensure="present") { # selinux labels differ from one distribution to another case $operatingsystem { - RedHat: { + RedHat, CentOS: { case $lsbmajdistrelease { "4": { $postfix_seltype = "etc_t" } "5": { $postfix_seltype = "postfix_etc_t" } -- cgit v1.2.3 From 1156b6f823e94c963cb0db7586cf56b801ea930f Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sun, 15 Aug 2010 13:58:29 -0300 Subject: Adding source parameter at postfix::hash --- manifests/definitions/hash.pp | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) (limited to 'manifests/definitions') diff --git a/manifests/definitions/hash.pp b/manifests/definitions/hash.pp index 3f605f0..9fa508b 100644 --- a/manifests/definitions/hash.pp +++ b/manifests/definitions/hash.pp @@ -5,11 +5,10 @@ Creates postfix hashed "map" files. It will create "${name}", and then build "${name}.db" using the "postmap" command. The map file can then be referred to using postfix::config. -Note: the content of the file is not managed by this definition. - Parameters: - *name*: the name of the map file. -- *ensure*: present/absent, defaults to present +- *ensure*: present/absent, defaults to present. +- *source*: file source. Requires: - Class["postfix"] @@ -29,7 +28,7 @@ Example usage: } */ -define postfix::hash ($ensure="present") { +define postfix::hash ($ensure="present", $source = false) { # selinux labels differ from one distribution to another case $operatingsystem { @@ -47,11 +46,24 @@ define postfix::hash ($ensure="present") { } } - file {"${name}": - ensure => $ensure, - mode => 600, - seltype => $postfix_seltype, - require => Package["postfix"], + case $source { + false: { + file {"${name}": + ensure => $ensure, + mode => 600, + seltype => $postfix_seltype, + require => Package["postfix"], + } + } + default: { + file {"${name}": + ensure => $ensure, + mode => 600, + source => $source, + seltype => $postfix_seltype, + require => Package["postfix"], + } + } } file {"${name}.db": -- cgit v1.2.3 From 4250af19b6c1c2b854957d86dd7a7354f1f898e6 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 17 Aug 2010 22:31:07 -0300 Subject: Group and ownership for hash files --- manifests/definitions/hash.pp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'manifests/definitions') diff --git a/manifests/definitions/hash.pp b/manifests/definitions/hash.pp index 9fa508b..c8bb7c7 100644 --- a/manifests/definitions/hash.pp +++ b/manifests/definitions/hash.pp @@ -51,6 +51,8 @@ define postfix::hash ($ensure="present", $source = false) { file {"${name}": ensure => $ensure, mode => 600, + owner => root, + group => root, seltype => $postfix_seltype, require => Package["postfix"], } @@ -59,6 +61,8 @@ define postfix::hash ($ensure="present", $source = false) { file {"${name}": ensure => $ensure, mode => 600, + owner => root, + group => root, source => $source, seltype => $postfix_seltype, require => Package["postfix"], -- cgit v1.2.3 From 6193e0e0e9f2263d9a297cc0f19dffe1b25483de Mon Sep 17 00:00:00 2001 From: Jerome Charaoui Date: Thu, 23 Sep 2010 13:05:57 -0400 Subject: Add mailalias resource wrapper --- manifests/classes/postfix.pp | 3 +-- manifests/definitions/mailalias.pp | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 manifests/definitions/mailalias.pp (limited to 'manifests/definitions') diff --git a/manifests/classes/postfix.pp b/manifests/classes/postfix.pp index a9e1d3f..1d60a57 100644 --- a/manifests/classes/postfix.pp +++ b/manifests/classes/postfix.pp @@ -121,8 +121,7 @@ class postfix { } } - mailalias {"root": + postfix::mailalias {"root": recipient => $root_mail_recipient, - notify => Exec["newaliases"], } } diff --git a/manifests/definitions/mailalias.pp b/manifests/definitions/mailalias.pp new file mode 100644 index 0000000..0d457e7 --- /dev/null +++ b/manifests/definitions/mailalias.pp @@ -0,0 +1,32 @@ +/* +== Definition: postfix::mailalias + +Wrapper around Puppet mailalias resource, provides newaliases executable. + +Parameters: +- *name*: the name of the alias. +- *ensure*: present/absent, defaults to present. +- *recipient*: recipient of the alias. + +Requires: +- Class["postfix"] + +Example usage: + + node "toto.example.com" { + + include postfix + + postfix::mailalias { "postmaster": + ensure => present, + recipient => 'foo' + } + +*/ +define mailalias ($ensure = 'present', $recipient) { + mailalias { "${name}": + ensure => $ensure, + recipient => $recipient, + notify => Exec['newaliases'] + } +} -- cgit v1.2.3