Facts should be addressed with $::fqdn and so on.
*/
define postfix::hash ($ensure="present", $source = false) {
-
- # selinux labels differ from one distribution to another
- case $operatingsystem {
-
- RedHat, CentOS: {
- case $lsbmajdistrelease {
- "4": { $postfix_seltype = "etc_t" }
- "5": { $postfix_seltype = "postfix_etc_t" }
- default: { $postfix_seltype = undef }
- }
- }
-
- default: {
- $postfix_seltype = undef
- }
- }
-
+ include ::postfix
case $source {
false: {
file {"${name}":
mode => 600,
owner => root,
group => root,
- seltype => $postfix_seltype,
+ seltype => $postfix::postfix_seltype,
require => Package["postfix"],
}
}
owner => root,
group => root,
source => $source,
- seltype => $postfix_seltype,
+ seltype => $postfix::postfix_seltype,
require => Package["postfix"],
}
}
ensure => $ensure,
mode => 600,
require => [File["${name}"], Exec["generate ${name}.db"]],
- seltype => $postfix_seltype,
+ seltype => $postfix::postfix_seltype,
}
exec {"generate ${name}.db":
class postfix {
# selinux labels differ from one distribution to another
- case $operatingsystem {
+ case $::operatingsystem {
RedHat, CentOS: {
- case $lsbmajdistrelease {
+ case $::lsbmajdistrelease {
"4": { $postfix_seltype = "etc_t" }
"5": { $postfix_seltype = "postfix_etc_t" }
default: { $postfix_seltype = undef }
ensure => installed
}
- if $operatingsystem == 'debian' {
+ if $::operatingsystem == 'debian' {
Package[mailx] { name => 'bsd-mailx' }
}
owner => "root",
group => "root",
mode => "0644",
- content => $operatingsystem ? {
+ 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-${::lsbdistcodename}.erb"),
Ubuntu => template("postfix/master.cf.debian-etch.erb"),
},
seltype => $postfix_seltype,
"inet_interfaces": value => "${postfix_inet_interfaces}";
}
- case $operatingsystem {
+ case $::operatingsystem {
RedHat, CentOS: {
postfix::config {
"sendmail_path": value => "/usr/sbin/sendmail.postfix";
# If $valid_fqdn exists, use it to override $fqdn
case $valid_fqdn {
- "": { $valid_fqdn = $fqdn }
+ "": { $valid_fqdn = $::fqdn }
default: { $fqdn = "${valid_fqdn}" }
}