summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvarac <varacanero@zeromail.org>2015-12-01 14:50:56 +0100
committervarac <varacanero@zeromail.org>2015-12-01 16:26:44 +0100
commitf4201357e5da4cbdecd558218c262c01d92c4697 (patch)
treed39a5f0514f9365e4c4892b1cf0218b2f7cee6a7
parent1eea47c2f6b8f0290fb27558eb873563fc99758b (diff)
[refactor] Dont use case statement in resource def
-rw-r--r--manifests/init.pp22
1 files changed, 14 insertions, 8 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index 54f36e5..f92e20b 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -56,10 +56,12 @@ class postfix(
$default_alias_maps = true
) {
- # selinux labels differ from one distribution to another
case $::operatingsystem {
RedHat, CentOS: {
+ $master_cf_template = 'postfix/master.cf.redhat5.erb'
+
+ # selinux labels differ from one distribution to another
case $::operatingsystemmajrelease {
'4': { $postfix_seltype = 'etc_t' }
'5': { $postfix_seltype = 'postfix_etc_t' }
@@ -67,8 +69,17 @@ class postfix(
}
}
+ 'Debian': {
+ $master_cf_template = "postfix/master.cf.debian-${::operatingsystemmajrelease}.erb"
+ }
+
+ 'Ubuntu': {
+ $master_cf_template = 'postfix/master.cf.debian-sid.erb'
+ }
+
default: {
- $postfix_seltype = undef
+ $postfix_seltype = undef
+ $master_cf_template = undef
}
}
@@ -142,12 +153,7 @@ class postfix(
owner => 'root',
group => 'root',
mode => '0644',
- content => $::operatingsystem ? {
- Redhat => template('postfix/master.cf.redhat5.erb'),
- CentOS => template('postfix/master.cf.redhat5.erb'),
- Debian => template("postfix/master.cf.debian-${::operatingsystemmajrelease}.erb"),
- Ubuntu => template('postfix/master.cf.debian-etch.erb'),
- },
+ content => template($master_cf_template),
seltype => $postfix_seltype,
notify => Service['postfix'],
require => Package['postfix'],