From f9068edca5cd1dfd4348a9285df447a293d287fd Mon Sep 17 00:00:00 2001 From: mh Date: Wed, 9 Jul 2014 23:14:42 +0200 Subject: get rid off lsb facts --- manifests/init.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'manifests') diff --git a/manifests/init.pp b/manifests/init.pp index c7b9ce8..3d51bb1 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -59,7 +59,7 @@ class postfix( case $::operatingsystem { RedHat, CentOS: { - case $::lsbmajdistrelease { + case $::operatingsystemmajrelease { "4": { $postfix_seltype = "etc_t" } "5": { $postfix_seltype = "postfix_etc_t" } default: { $postfix_seltype = undef } @@ -143,7 +143,7 @@ class postfix( content => $::operatingsystem ? { Redhat => template("postfix/master.cf.redhat5.erb"), CentOS => template("postfix/master.cf.redhat5.erb"), - Debian => template("postfix/master.cf.debian-${::lsbdistcodename}.erb"), + Debian => template("postfix/master.cf.debian-${::operatingsystemmajrelease}.erb"), Ubuntu => template("postfix/master.cf.debian-etch.erb"), }, seltype => $postfix_seltype, -- cgit v1.2.3 From 6e051c3b8567c78ce029b1fac514dbd6975effa0 Mon Sep 17 00:00:00 2001 From: Jerome Charaoui Date: Fri, 20 Feb 2015 17:06:47 -0500 Subject: convert to file resources to stdlib's file_line --- manifests/transport.pp | 4 ++-- manifests/virtual.pp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'manifests') diff --git a/manifests/transport.pp b/manifests/transport.pp index 90c5468..bab9574 100644 --- a/manifests/transport.pp +++ b/manifests/transport.pp @@ -34,9 +34,9 @@ Example usage: */ define postfix::transport ($ensure="present", $destination) { - line {"${name} ${destination}": + file_line {"${name} ${destination}": ensure => $ensure, - file => "/etc/postfix/transport", + path => "/etc/postfix/transport", line => "${name} ${destination}", notify => Exec["generate /etc/postfix/transport.db"], require => Package["postfix"], diff --git a/manifests/virtual.pp b/manifests/virtual.pp index d6912a4..4a434d2 100644 --- a/manifests/virtual.pp +++ b/manifests/virtual.pp @@ -34,9 +34,9 @@ Example usage: */ define postfix::virtual ($ensure="present", $destination) { - line {"${name} ${destination}": + file_line {"${name} ${destination}": ensure => $ensure, - file => "/etc/postfix/virtual", + path => "/etc/postfix/virtual", line => "${name} ${destination}", notify => Exec["generate /etc/postfix/virtual.db"], require => Package["postfix"], -- cgit v1.2.3 From 538debac1f0410a6bb84827e13a3ce393eedcded Mon Sep 17 00:00:00 2001 From: Jerome Charaoui Date: Fri, 20 Feb 2015 17:16:08 -0500 Subject: fix module dependency comment in transport and virtual --- manifests/transport.pp | 2 +- manifests/virtual.pp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'manifests') diff --git a/manifests/transport.pp b/manifests/transport.pp index bab9574..08b93e5 100644 --- a/manifests/transport.pp +++ b/manifests/transport.pp @@ -12,7 +12,7 @@ Requires: - Class["postfix"] - Postfix::Hash["/etc/postfix/transport"] - Postfix::Config["transport_maps"] -- common::line (from module common) +- file_line (from module stdlib) Example usage: diff --git a/manifests/virtual.pp b/manifests/virtual.pp index 4a434d2..06df32a 100644 --- a/manifests/virtual.pp +++ b/manifests/virtual.pp @@ -12,7 +12,7 @@ Requires: - Class["postfix"] - Postfix::Hash["/etc/postfix/virtual"] - Postfix::Config["virtual_alias_maps"] -- common::line (from module common) +- file_line (from module stdlib) Example usage: -- cgit v1.2.3 From a61349e001b807f23eea3e4d7d97cd9c83fcd6f9 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Sat, 28 Feb 2015 12:08:10 +0000 Subject: Fix usage of the common::module_dir. --- manifests/init.pp | 2 +- manifests/tlspolicy.pp | 2 +- manifests/transport_regexp.pp | 2 +- manifests/virtual_regexp.pp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'manifests') diff --git a/manifests/init.pp b/manifests/init.pp index 3d51bb1..f454be9 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -74,7 +74,7 @@ class postfix( # Bootstrap moduledir include common::moduledir - module_dir{'postfix': } + common::module_dir{'postfix': } # Include optional classes if $anon_sasl == 'yes' { diff --git a/manifests/tlspolicy.pp b/manifests/tlspolicy.pp index e1272b9..d901710 100644 --- a/manifests/tlspolicy.pp +++ b/manifests/tlspolicy.pp @@ -16,7 +16,7 @@ class postfix::tlspolicy( ) { include common::moduledir - module_dir{'postfix/tls_policy': } + common::module_dir{'postfix/tls_policy': } $postfix_tlspolicy_dir = "${common::moduledir::module_dir_path}/postfix/tls_policy" $postfix_merged_tlspolicy = "${postfix_tlspolicy_dir}/merged_tls_policy" diff --git a/manifests/transport_regexp.pp b/manifests/transport_regexp.pp index eaa78da..4961141 100644 --- a/manifests/transport_regexp.pp +++ b/manifests/transport_regexp.pp @@ -22,7 +22,7 @@ class postfix::transport_regexp { include common::moduledir - module_dir{'postfix/transport_regexp': } + common::module_dir{'postfix/transport_regexp': } $postfix_transport_regexp_dir = "${common::moduledir::module_dir_path}/postfix/transport_regexp" $postfix_transport_regexp_snippets_dir = "${postfix_transport_regexp_dir}/transport_regexp.d" diff --git a/manifests/virtual_regexp.pp b/manifests/virtual_regexp.pp index af68ec6..18bbd8c 100644 --- a/manifests/virtual_regexp.pp +++ b/manifests/virtual_regexp.pp @@ -22,7 +22,7 @@ class postfix::virtual_regexp { include common::moduledir - module_dir{'postfix/virtual_regexp': } + common::module_dir{'postfix/virtual_regexp': } $postfix_virtual_regexp_dir = "${common::moduledir::module_dir_path}/postfix/virtual_regexp" $postfix_virtual_regexp_snippets_dir = "${postfix_virtual_regexp_dir}/virtual_regexp.d" -- cgit v1.2.3 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 (limited to 'manifests') 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(-) (limited to 'manifests') 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(-) (limited to 'manifests') 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 5d25ec9d1ec77d735d393ef7cab7d1232e3d8997 Mon Sep 17 00:00:00 2001 From: varac Date: Thu, 5 Mar 2015 09:23:05 +0100 Subject: fix postfix::satellite class MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit i got this error using postfix::satellite: Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Cannot reassign variable valid_fqdn at /etc/puppet/modules/postfix/manifests/satellite.pp:32 … reassigning a variable within a given scope doesn't work in puppet see https://docs.puppetlabs.com/puppet/latest/reference/lang_variables.html#no-reassignment i still think overriding $::fqdn is not a good idea, but for now, i just want to get this class working again. --- manifests/satellite.pp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'manifests') diff --git a/manifests/satellite.pp b/manifests/satellite.pp index 739c625..45a40ad 100644 --- a/manifests/satellite.pp +++ b/manifests/satellite.pp @@ -21,16 +21,16 @@ # } # } # + class postfix::satellite( $relayhost = '', - $valid_fqdn = '', + $valid_fqdn = $::fqdn, $root_mail_recipient = '' ) { - # If $valid_fqdn exists, use it to override $fqdn - case $valid_fqdn { - "": { $valid_fqdn = $::fqdn } - default: { $fqdn = "${valid_fqdn}" } + # If $valid_fqdn is provided, use it to override $fqdn + if $valid_fqdn != $::fdqn { + $fqdn = $valid_fqdn } class { '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(-) (limited to 'manifests') 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(-) (limited to 'manifests') 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(-) (limited to 'manifests') 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