2015-03-04 09:24:55 +01:00
|
|
|
# == Definition: postfix::smtp_auth
|
|
|
|
#
|
|
|
|
# Manages content of the /etc/postfix/smtp_auth map.
|
|
|
|
#
|
|
|
|
# Requires:
|
|
|
|
# - Class["postfix"]
|
|
|
|
# - Postfix::Hash["/etc/postfix/smtp_auth"]
|
2015-03-08 17:46:44 +01:00
|
|
|
# - file_line (from puppetlab's stdlib module)
|
2015-03-04 09:24:55 +01:00
|
|
|
#
|
|
|
|
# Example usage:
|
|
|
|
#
|
|
|
|
# node 'toto.example.com' {
|
|
|
|
#
|
|
|
|
# include postfix
|
|
|
|
#
|
|
|
|
# postfix::hash { '/etc/postfix/smtp_auth':
|
|
|
|
# ensure => present,
|
|
|
|
# }
|
2015-03-11 23:51:41 +01:00
|
|
|
# postfix::config { 'smtp_auth_maps':
|
2015-03-04 09:24:55 +01:00
|
|
|
# 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) {
|
2015-03-05 09:09:00 +01:00
|
|
|
file_line { $name:
|
2015-03-08 17:47:31 +01:00
|
|
|
ensure => $ensure,
|
|
|
|
path => '/etc/postfix/smtp_auth',
|
|
|
|
line => "${name} ${user}:${password}",
|
|
|
|
notify => Exec['generate /etc/postfix/smtp_auth.db'],
|
|
|
|
require => Package['postfix'],
|
|
|
|
}
|
2013-01-22 22:26:01 +01:00
|
|
|
}
|