From 18661db4da9bb3f599ee473993c267de918fa0ce Mon Sep 17 00:00:00 2001 From: Francois Deppierraz Date: Tue, 22 Dec 2009 20:28:15 +0100 Subject: Breaks backward compat: A few $postfix_ng_ variables were changed into $postfix_ variables --- manifests/classes/postfix-mailman.pp | 2 +- manifests/classes/postfix-mta.pp | 4 ++-- manifests/classes/postfix.pp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'manifests') diff --git a/manifests/classes/postfix-mailman.pp b/manifests/classes/postfix-mailman.pp index c6c7981..cba0848 100644 --- a/manifests/classes/postfix-mailman.pp +++ b/manifests/classes/postfix-mailman.pp @@ -15,7 +15,7 @@ # } # class postfix::mailman { - $postfix_ng_smtp_listen = "0.0.0.0" + $postfix_smtp_listen = "0.0.0.0" include postfix postfix::config { diff --git a/manifests/classes/postfix-mta.pp b/manifests/classes/postfix-mta.pp index 9046bad..16b1981 100644 --- a/manifests/classes/postfix-mta.pp +++ b/manifests/classes/postfix-mta.pp @@ -2,7 +2,7 @@ # == Class: postfix::mta # # This class configures a minimal MTA, listening on -# $postfix_ng_smtp_listen (default to localhost) and delivering mail to +# $postfix_smtp_listen (default to localhost) and delivering mail to # $postfix_mydestination (default to $fqdn). # # A valid relay host is required ($postfix_relayhost) for outbound email. @@ -19,7 +19,7 @@ # # node "toto.example.com" { # $postfix_relayhost = "mail.example.com" -# $postfix_ng_smtp_listen = "0.0.0.0" +# $postfix_smtp_listen = "0.0.0.0" # $postfix_mydestination = "\$myorigin, myapp.example.com" # # include postfix::mta diff --git a/manifests/classes/postfix.pp b/manifests/classes/postfix.pp index 8c4173e..91a33e3 100644 --- a/manifests/classes/postfix.pp +++ b/manifests/classes/postfix.pp @@ -34,8 +34,8 @@ class postfix { } # Default value for various options - case $postfix_ng_smtp_listen { - "": { $postfix_ng_smtp_listen = "127.0.0.1" } + case $postfix_smtp_listen { + "": { $postfix_smtp_listen = "127.0.0.1" } } case $root_mail_recipient { "": { $root_mail_recipient = "nobody" } -- cgit v1.2.3 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/classes/postfix.pp | 6 ++++-- manifests/definitions/hash.pp | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'manifests') diff --git a/manifests/classes/postfix.pp b/manifests/classes/postfix.pp index 91a33e3..f1f803a 100644 --- a/manifests/classes/postfix.pp +++ b/manifests/classes/postfix.pp @@ -20,7 +20,7 @@ class postfix { # 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" } @@ -81,7 +81,9 @@ class postfix { mode => "0644", content => $operatingsystem ? { Redhat => template("postfix/master.cf.redhat5.erb"), + CentOS => template("postfix/master.cf.redhat5.erb"), Debian => template("postfix/master.cf.debian-etch.erb"), + Ubuntu => template("postfix/master.cf.debian-etch.erb"), }, seltype => $postfix_seltype, notify => Service["postfix"], @@ -108,7 +110,7 @@ class postfix { } case $operatingsystem { - RedHat: { + RedHat, CentOS: { postfix::config { "sendmail_path": value => "/usr/sbin/sendmail.postfix"; "newaliases_path": value => "/usr/bin/newaliases.postfix"; 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 2703cae7300bcb545e94d1e7ae806f5995548520 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sun, 8 Aug 2010 00:42:55 -0300 Subject: Group for main.cf and master.cf --- manifests/classes/postfix.pp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'manifests') diff --git a/manifests/classes/postfix.pp b/manifests/classes/postfix.pp index f1f803a..a3bbef9 100644 --- a/manifests/classes/postfix.pp +++ b/manifests/classes/postfix.pp @@ -78,6 +78,7 @@ class postfix { file { "/etc/postfix/master.cf": ensure => present, owner => "root", + group => "root", mode => "0644", content => $operatingsystem ? { Redhat => template("postfix/master.cf.redhat5.erb"), @@ -94,6 +95,7 @@ class postfix { file { "/etc/postfix/main.cf": ensure => present, owner => "root", + group => "root", mode => "0644", source => "puppet:///postfix/main.cf", replace => false, -- 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') 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') 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 328c20af92a410bba35457c61a4882c489e0d9dd Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 14 Sep 2010 18:27:45 -0300 Subject: Fixing deprecation issue --- manifests/classes/postfix.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'manifests') diff --git a/manifests/classes/postfix.pp b/manifests/classes/postfix.pp index a3bbef9..a9e1d3f 100644 --- a/manifests/classes/postfix.pp +++ b/manifests/classes/postfix.pp @@ -97,7 +97,7 @@ class postfix { owner => "root", group => "root", mode => "0644", - source => "puppet:///postfix/main.cf", + source => "puppet:///modules/postfix/main.cf", replace => false, seltype => $postfix_seltype, notify => Service["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') 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