diff options
author | Micah <micah@leap.se> | 2016-05-24 10:19:37 -0400 |
---|---|---|
committer | Micah <micah@leap.se> | 2016-05-24 10:19:37 -0400 |
commit | 38ac177664f763f08153239992568f1aad04c89b (patch) | |
tree | 3bb398154ea70b4320f4b4597a8aba8b83a9cf19 /puppet/modules/postfix/manifests/smtp_auth.pp | |
parent | 93ff36e36236542e6b2a35b0c03a69623662a298 (diff) | |
parent | 6570cad05280d8fc9c9c22a403e1dc234ca6ab25 (diff) |
Merge commit '6570cad05280d8fc9c9c22a403e1dc234ca6ab25' as 'puppet/modules/postfix'
Diffstat (limited to 'puppet/modules/postfix/manifests/smtp_auth.pp')
-rw-r--r-- | puppet/modules/postfix/manifests/smtp_auth.pp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/puppet/modules/postfix/manifests/smtp_auth.pp b/puppet/modules/postfix/manifests/smtp_auth.pp new file mode 100644 index 00000000..b553fb5b --- /dev/null +++ b/puppet/modules/postfix/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'], + } +} |