class postfix {
+ case $operatingsystem {
+
+ RedHat: {
+ case $lsbmajdistrelease {
+ "4": { $postfix_seltype = "etc_t" }
+ "5": { $postfix_seltype = "postfix_etc_t" }
+ default: { $postfix_seltype = undef }
+ }
+ }
+
+ default: {
+ $postfix_seltype = undef
+ }
+ }
+
# Default value for various options
case $postfix_ng_smtp_listen {
"": { $postfix_ng_smtp_listen = "127.0.0.1" }
file { "/etc/mailname":
ensure => present,
content => "${fqdn}\n",
- seltype => "postfix_etc_t",
+ seltype => $postfix_seltype,
}
# Aliases
ensure => present,
content => "# file managed by puppet\n",
replace => false,
- seltype => "postfix_etc_t",
+ seltype => $postfix_seltype,
notify => Exec["newaliases"],
}
Redhat => template("postfix/master.cf.redhat5.erb"),
Debian => template("postfix/master.cf.debian-etch.erb"),
},
+ seltype => $postfix_seltype,
notify => Service["postfix"],
require => Package["postfix"],
}
mode => "0644",
source => "puppet:///postfix/main.cf",
replace => false,
+ seltype => $postfix_seltype,
notify => Service["postfix"],
require => Package["postfix"],
}
define postfix::hash ($ensure) {
+
+ case $operatingsystem {
+
+ RedHat: {
+ case $lsbmajdistrelease {
+ "4": { $postfix_seltype = "etc_t" }
+ "5": { $postfix_seltype = "postfix_etc_t" }
+ default: { $postfix_seltype = undef }
+ }
+ }
+
+ default: {
+ $postfix_seltype = undef
+ }
+ }
+
file {"${name}":
ensure => $ensure,
mode => 600,
- seltype => "postfix_etc_t",
+ seltype => $postfix_seltype,
require => Package["postfix"],
}
ensure => $ensure,
mode => 600,
require => [File["${name}"], Exec["generate ${name}.db"]],
- seltype => "postfix_etc_t",
+ seltype => $postfix_seltype,
}
exec {"generate ${name}.db":