diff options
| author | Silvio Rhatto <rhatto@riseup.net> | 2017-12-30 14:01:39 -0200 |
|---|---|---|
| committer | Silvio Rhatto <rhatto@riseup.net> | 2017-12-30 14:01:39 -0200 |
| commit | 3933b4048a4437987930bb370dd99b7e189f67ae (patch) | |
| tree | 422c921949186de5fdcbe23e613188774b3c0796 /manifests | |
| parent | ae05fced176bfdb5a23784614594306ef45ae9ee (diff) | |
| parent | 3e7dd131f38bf19d9ed8f38ba276a3d9bf4b1508 (diff) | |
| download | puppet-postfix-3933b4048a4437987930bb370dd99b7e189f67ae.tar.gz puppet-postfix-3933b4048a4437987930bb370dd99b7e189f67ae.tar.bz2 | |
Merge branch 'develop' into production
Diffstat (limited to 'manifests')
| -rw-r--r-- | manifests/hash.pp | 6 | ||||
| -rw-r--r-- | manifests/header_checks_snippet.pp | 20 | ||||
| -rw-r--r-- | manifests/init.pp | 18 | ||||
| -rw-r--r-- | manifests/tlspolicy.pp | 2 | ||||
| -rw-r--r-- | manifests/transport_regexp_snippet.pp | 20 | ||||
| -rw-r--r-- | manifests/virtual_regexp_snippet.pp | 20 |
6 files changed, 41 insertions, 45 deletions
diff --git a/manifests/hash.pp b/manifests/hash.pp index 0670c0f..b180568 100644 --- a/manifests/hash.pp +++ b/manifests/hash.pp @@ -34,7 +34,7 @@ define postfix::hash ($ensure="present", $source = false) { false: { file {"${name}": ensure => $ensure, - mode => '600', + mode => '0600', owner => root, group => root, seltype => $postfix::postfix_seltype, @@ -44,7 +44,7 @@ define postfix::hash ($ensure="present", $source = false) { default: { file {"${name}": ensure => $ensure, - mode => '600', + mode => '0600', owner => root, group => root, source => $source, @@ -56,7 +56,7 @@ define postfix::hash ($ensure="present", $source = false) { file {"${name}.db": ensure => $ensure, - mode => '600', + mode => '0600', require => [File["${name}"], Exec["generate ${name}.db"]], seltype => $postfix::postfix_seltype, } diff --git a/manifests/header_checks_snippet.pp b/manifests/header_checks_snippet.pp index 05929a3..82ead84 100644 --- a/manifests/header_checks_snippet.pp +++ b/manifests/header_checks_snippet.pp @@ -44,17 +44,13 @@ define postfix::header_checks_snippet ( concat::fragment { "$fragment": ensure => "$ensure", target => '/etc/postfix/header_checks', + source => $source ? { + undef => undef, + default => $source, + }, + content => $content ? { + undef => undef, + default => $content, + }, } - - if $source { - Concat::Fragment["$fragment"] { - source => $source, - } - } - else { - Concat::Fragment["$fragment"] { - content => $content, - } - } - } diff --git a/manifests/init.pp b/manifests/init.pp index d298183..8ee2346 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -77,10 +77,12 @@ class postfix( 'Debian': { $master_cf_template = "postfix/master.cf.debian-${::operatingsystemmajrelease}.erb" + $postfix_seltype = undef } 'Ubuntu': { $master_cf_template = 'postfix/master.cf.debian-sid.erb' + $postfix_seltype = undef } default: { @@ -99,7 +101,7 @@ class postfix( include postfix::anonsasl } # this global variable needs to get parameterized as well - if $::header_checks == 'yes' { + if $manage_header_checks == 'yes' { include postfix::header_checks } if $manage_tls_policy == 'yes' { @@ -117,12 +119,18 @@ class postfix( include postfix::virtual_regexp } - package { ['postfix', 'mailx']: - ensure => installed + package { 'postfix': + ensure => installed, } - if $::operatingsystem == 'debian' { - Package[mailx] { name => 'bsd-mailx' } + if !defined(Package['mailx']) { + package { 'mailx': + ensure => installed, + name => $::operatingsystem ? { + debian => 'bsd-mailx', + default => 'mailx', + }, + } } service { 'postfix': diff --git a/manifests/tlspolicy.pp b/manifests/tlspolicy.pp index d901710..bf96503 100644 --- a/manifests/tlspolicy.pp +++ b/manifests/tlspolicy.pp @@ -30,7 +30,7 @@ class postfix::tlspolicy( postfix::hash { '/etc/postfix/tls_policy': source => "$postfix_merged_tlspolicy", - subscribe => File["$postfix_merged_tlspolicy"], + subscribe => Concat["$postfix_merged_tlspolicy"], } postfix::config { diff --git a/manifests/transport_regexp_snippet.pp b/manifests/transport_regexp_snippet.pp index 88c72e1..1588c00 100644 --- a/manifests/transport_regexp_snippet.pp +++ b/manifests/transport_regexp_snippet.pp @@ -44,17 +44,13 @@ define postfix::transport_regexp_snippet ( concat::fragment { "$fragment": ensure => "$ensure", target => '/etc/postfix/transport_regexp', + source => $source ? { + undef => undef, + default => $source, + }, + content => $content ? { + undef => undef, + default => $content, + }, } - - if $source { - Concat::Fragment["$fragment"] { - source => $source, - } - } - else { - Concat::Fragment["$fragment"] { - content => $content, - } - } - } diff --git a/manifests/virtual_regexp_snippet.pp b/manifests/virtual_regexp_snippet.pp index 6252fd2..8e376b7 100644 --- a/manifests/virtual_regexp_snippet.pp +++ b/manifests/virtual_regexp_snippet.pp @@ -44,17 +44,13 @@ define postfix::virtual_regexp_snippet ( concat::fragment { "$fragment": ensure => "$ensure", target => '/etc/postfix/virtual_regexp', + source => $source ? { + undef => undef, + default => $source, + }, + content => $content ? { + undef => undef, + default => $content, + }, } - - if $source { - Concat::Fragment["$fragment"] { - source => $source, - } - } - else { - Concat::Fragment["$fragment"] { - content => $content, - } - } - } |
