diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2016-06-17 20:57:21 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2016-06-17 20:57:21 -0300 |
commit | c38a65d0c8565ebe3d22a72c396f233929b93287 (patch) | |
tree | 90592df1a872e4f2a1c571a25b9552688df16690 /manifests/smtp_auth.pp | |
parent | 50a114ab258bd5b9186b61a9c73d82f2ffdab3f6 (diff) | |
parent | 969076a813b88dafd222c413bf6fbabab837eafb (diff) | |
download | puppet-postfix-master.tar.gz puppet-postfix-master.tar.bz2 |
Conflicts:
manifests/init.pp
templates/master.cf.debian-7.erb
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'], + } +} |