diff options
author | Micah Anderson <micah@riseup.net> | 2015-05-06 14:12:01 -0400 |
---|---|---|
committer | Micah Anderson <micah@riseup.net> | 2015-05-06 14:12:01 -0400 |
commit | f7fc77ec14eedafc08895c7d2555d457c758b34e (patch) | |
tree | 9c6fdd468c007f7da4b5f3953f8479082f2def22 /manifests | |
parent | 1103a73ab4253712c6446bba7a443619fe516717 (diff) | |
parent | 1fe24e63dc39bef3379b0e75d8c81f4f6db0072e (diff) |
Merge branch 'master' into leap
Conflicts:
manifests/satellite.pp
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/init.pp | 6 | ||||
-rw-r--r-- | manifests/satellite.pp | 7 | ||||
-rw-r--r-- | manifests/smtp_auth.pp | 37 | ||||
-rw-r--r-- | manifests/tlspolicy.pp | 2 | ||||
-rw-r--r-- | manifests/transport.pp | 6 | ||||
-rw-r--r-- | manifests/transport_regexp.pp | 2 | ||||
-rw-r--r-- | manifests/virtual.pp | 6 | ||||
-rw-r--r-- | manifests/virtual_regexp.pp | 2 |
8 files changed, 55 insertions, 13 deletions
diff --git a/manifests/init.pp b/manifests/init.pp index 77d26ba..a90e790 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -61,7 +61,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 } @@ -76,7 +76,7 @@ class postfix( # Bootstrap moduledir include common::moduledir - module_dir{'postfix': } + common::module_dir{'postfix': } # Include optional classes if $anon_sasl == 'yes' { @@ -155,7 +155,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, diff --git a/manifests/satellite.pp b/manifests/satellite.pp index da818a5..c6c1a0e 100644 --- a/manifests/satellite.pp +++ b/manifests/satellite.pp @@ -21,12 +21,17 @@ # } # } # -class postfix::satellite ( +class postfix::satellite( $relayhost = '', $valid_fqdn = $::fqdn, $root_mail_recipient = '' ) { + # If $valid_fqdn is provided, use it to override $fqdn + if $valid_fqdn != $::fdqn { + $fqdn = $valid_fqdn + } + class { 'postfix': root_mail_recipient => $root_mail_recipient, myorigin => $valid_fqdn, 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'], + } +} 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.pp b/manifests/transport.pp index 90c5468..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: @@ -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/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.pp b/manifests/virtual.pp index d6912a4..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: @@ -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"], 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" |