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/hash.pp') 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/hash.pp') 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/hash.pp') 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