summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2010-08-15 13:58:29 -0300
committerSilvio Rhatto <rhatto@riseup.net>2010-08-15 13:58:29 -0300
commit1156b6f823e94c963cb0db7586cf56b801ea930f (patch)
treeeab1dac38285840339055569a0e81d6d6bc315b9
parenteef9c501a2c65f60a77520575b2740bfbc9a2ec4 (diff)
Adding source parameter at postfix::hash
-rw-r--r--manifests/definitions/hash.pp30
1 files changed, 21 insertions, 9 deletions
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":