diff options
author | Micah Anderson <micah@riseup.net> | 2015-05-06 14:12:01 -0400 |
---|---|---|
committer | Micah Anderson <micah@riseup.net> | 2015-05-06 14:12:01 -0400 |
commit | f7fc77ec14eedafc08895c7d2555d457c758b34e (patch) | |
tree | 9c6fdd468c007f7da4b5f3953f8479082f2def22 /manifests/smtp_auth.pp | |
parent | 1103a73ab4253712c6446bba7a443619fe516717 (diff) | |
parent | 1fe24e63dc39bef3379b0e75d8c81f4f6db0072e (diff) |
Merge branch 'master' into leap
Conflicts:
manifests/satellite.pp
Diffstat (limited to 'manifests/smtp_auth.pp')
-rw-r--r-- | manifests/smtp_auth.pp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/manifests/smtp_auth.pp b/manifests/smtp_auth.pp new file mode 100644 index 0000000..b553fb5 --- /dev/null +++ b/manifests/smtp_auth.pp @@ -0,0 +1,37 @@ +# == Definition: postfix::smtp_auth +# +# Manages content of the /etc/postfix/smtp_auth map. +# +# Requires: +# - Class["postfix"] +# - Postfix::Hash["/etc/postfix/smtp_auth"] +# - file_line (from puppetlab's stdlib module) +# +# Example usage: +# +# node 'toto.example.com' { +# +# include postfix +# +# postfix::hash { '/etc/postfix/smtp_auth': +# ensure => present, +# } +# postfix::config { 'smtp_auth_maps': +# value => 'hash:/etc/postfix/smtp_auth' +# } +# postfix::smtp_auth { 'gmail.com': +# ensure => present, +# user => 'USER', +# password => 'PW', +# } +# } + +define postfix::smtp_auth ($user, $password, $ensure=present) { + file_line { $name: + ensure => $ensure, + path => '/etc/postfix/smtp_auth', + line => "${name} ${user}:${password}", + notify => Exec['generate /etc/postfix/smtp_auth.db'], + require => Package['postfix'], + } +} |