From 49f1024e1673c50c728d51a542c82b7a7cc4505b Mon Sep 17 00:00:00 2001 From: varac Date: Tue, 22 Jan 2013 22:26:01 +0100 Subject: added smtp_auth.pp --- manifests/smtp_auth.pp | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 manifests/smtp_auth.pp 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"], + } + +} -- cgit v1.2.3 From 316dedeb142e05f75200f32636c11659f060626e Mon Sep 17 00:00:00 2001 From: varac Date: Wed, 4 Mar 2015 09:24:55 +0100 Subject: linted smtp_auth.pp --- manifests/smtp_auth.pp | 74 ++++++++++++++++++++++++-------------------------- 1 file changed, 35 insertions(+), 39 deletions(-) diff --git a/manifests/smtp_auth.pp b/manifests/smtp_auth.pp index 191f234..ae6a9a5 100644 --- a/manifests/smtp_auth.pp +++ b/manifests/smtp_auth.pp @@ -1,41 +1,37 @@ -/* -== 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", - } +# == 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 ($user, $password, $ensure=present) { + line { $name: + ensure => $ensure, + file => '/etc/postfix/smtp_auth', + line => "${name} ${user}:${password}", + notify => Exec['generate /etc/postfix/smtp_auth.db'], + require => Package['postfix'], } -*/ - - -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"], - } - } -- cgit v1.2.3 From 06a63a98fc975d53dfe11e1d15ddd6c7f5607cbc Mon Sep 17 00:00:00 2001 From: varac Date: Thu, 5 Mar 2015 09:09:00 +0100 Subject: use stdlib file_line instead of deprecated line from common module --- manifests/smtp_auth.pp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/manifests/smtp_auth.pp b/manifests/smtp_auth.pp index ae6a9a5..845a38b 100644 --- a/manifests/smtp_auth.pp +++ b/manifests/smtp_auth.pp @@ -27,11 +27,11 @@ # } define postfix::smtp_auth ($user, $password, $ensure=present) { - line { $name: - ensure => $ensure, - file => '/etc/postfix/smtp_auth', - line => "${name} ${user}:${password}", - notify => Exec['generate /etc/postfix/smtp_auth.db'], - require => Package['postfix'], - } + 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'], + } } -- cgit v1.2.3 From c4b0de71fe3201fa8c83b61e571a7aed690edb6c Mon Sep 17 00:00:00 2001 From: Gabriel Filion Date: Sun, 8 Mar 2015 12:46:44 -0400 Subject: fix smtp_auth requirements in comment last commit moved requirement from the common module to puppetlab's stdlib --- manifests/smtp_auth.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/smtp_auth.pp b/manifests/smtp_auth.pp index 845a38b..6a13a0d 100644 --- a/manifests/smtp_auth.pp +++ b/manifests/smtp_auth.pp @@ -5,7 +5,7 @@ # Requires: # - Class["postfix"] # - Postfix::Hash["/etc/postfix/smtp_auth"] -# - common::line (from module common) +# - file_line (from puppetlab's stdlib module) # # Example usage: # -- cgit v1.2.3 From 2021023f31043e44de5bf2733bb12a66c33a6c71 Mon Sep 17 00:00:00 2001 From: Gabriel Filion Date: Sun, 8 Mar 2015 12:47:31 -0400 Subject: lint smtp_auth (spacing style) --- manifests/smtp_auth.pp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/manifests/smtp_auth.pp b/manifests/smtp_auth.pp index 6a13a0d..882b01d 100644 --- a/manifests/smtp_auth.pp +++ b/manifests/smtp_auth.pp @@ -28,10 +28,10 @@ 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'], - } + ensure => $ensure, + path => '/etc/postfix/smtp_auth', + line => "${name} ${user}:${password}", + notify => Exec['generate /etc/postfix/smtp_auth.db'], + require => Package['postfix'], + } } -- cgit v1.2.3 From 3c89b7deacffa570d03282368689069f388170de Mon Sep 17 00:00:00 2001 From: Gabriel Filion Date: Wed, 11 Mar 2015 18:51:41 -0400 Subject: small typo in smtp_auth example --- manifests/smtp_auth.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/smtp_auth.pp b/manifests/smtp_auth.pp index 882b01d..b553fb5 100644 --- a/manifests/smtp_auth.pp +++ b/manifests/smtp_auth.pp @@ -16,7 +16,7 @@ # postfix::hash { '/etc/postfix/smtp_auth': # ensure => present, # } -# postfix::config { 'smpt_auth_maps': +# postfix::config { 'smtp_auth_maps': # value => 'hash:/etc/postfix/smtp_auth' # } # postfix::smtp_auth { 'gmail.com': -- cgit v1.2.3