aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvarac <varacanero@zeromail.org>2013-01-22 22:26:01 +0100
committervarac <varacanero@zeromail.org>2015-03-04 09:18:37 +0100
commit49f1024e1673c50c728d51a542c82b7a7cc4505b (patch)
treef2cb745970cc97d7b98f6a1750212fcb5c4251ca
parenta9ec67ca025197e9e85b6d6752f76ff8cac37f92 (diff)
downloadpuppet-postfix-49f1024e1673c50c728d51a542c82b7a7cc4505b.tar.gz
puppet-postfix-49f1024e1673c50c728d51a542c82b7a7cc4505b.tar.bz2
added smtp_auth.pp
-rw-r--r--manifests/smtp_auth.pp41
1 files changed, 41 insertions, 0 deletions
diff --git a/manifests/smtp_auth.pp b/manifests/smtp_auth.pp
new file mode 100644
index 0000000..191f234
--- /dev/null
+++ b/manifests/smtp_auth.pp
@@ -0,0 +1,41 @@
+/*
+== Definition: postfix::smtp_auth
+
+Manages content of the /etc/postfix/smtp_auth map.
+
+Requires:
+- Class["postfix"]
+- Postfix::Hash["/etc/postfix/smtp_auth"]
+- common::line (from module common)
+
+Example usage:
+
+ node "toto.example.com" {
+
+ include postfix
+
+ postfix::hash { "/etc/postfix/smtp_auth":
+ ensure => present,
+ }
+ postfix::config { "smpt_auth_maps":
+ value => "hash:/etc/postfix/smtp_auth"
+ }
+ postfix::smtp_auth { "gmail.com":
+ ensure => present,
+ user => "USER",
+ password => "PW",
+ }
+ }
+*/
+
+
+define postfix::smtp_auth ($ensure="present", $user, $password) {
+ line {"${name}":
+ ensure => $ensure,
+ file => "/etc/postfix/smtp_auth",
+ line => "${name} ${user}:${password}",
+ notify => Exec["generate /etc/postfix/smtp_auth.db"],
+ require => Package["postfix"],
+ }
+
+}