aboutsummaryrefslogtreecommitdiff
path: root/manifests/definitions
diff options
context:
space:
mode:
authorvarac <varacanero@zeromail.org>2010-11-02 18:26:55 +0100
committervarac <varacanero@zeromail.org>2010-11-02 18:26:55 +0100
commit070c247e96ac14630975f8ac065ee7976fd7f0b6 (patch)
treec36a7ba63884734a796b73aa0e5c63db472d0d31 /manifests/definitions
parent60544a57c9e2d014061d2c2775654918890a648c (diff)
parent6193e0e0e9f2263d9a297cc0f19dffe1b25483de (diff)
downloadpuppet-postfix-070c247e96ac14630975f8ac065ee7976fd7f0b6.tar.gz
puppet-postfix-070c247e96ac14630975f8ac065ee7976fd7f0b6.tar.bz2
merge with git://labs.riseup.net/shared-postfix
Diffstat (limited to 'manifests/definitions')
-rw-r--r--manifests/definitions/hash.pp36
-rw-r--r--manifests/definitions/mailalias.pp32
2 files changed, 58 insertions, 10 deletions
diff --git a/manifests/definitions/hash.pp b/manifests/definitions/hash.pp
index a0514ee..c8bb7c7 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,12 +28,12 @@ Example usage:
}
*/
-define postfix::hash ($ensure="present") {
+define postfix::hash ($ensure="present", $source = false) {
# 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" }
@@ -47,11 +46,28 @@ 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,
+ owner => root,
+ group => root,
+ seltype => $postfix_seltype,
+ require => Package["postfix"],
+ }
+ }
+ default: {
+ file {"${name}":
+ ensure => $ensure,
+ mode => 600,
+ owner => root,
+ group => root,
+ source => $source,
+ seltype => $postfix_seltype,
+ require => Package["postfix"],
+ }
+ }
}
file {"${name}.db":
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']
+ }
+}