Removed verbose definitions per OS via group variable.
This commit is contained in:
parent
42cec9dbf4
commit
909a06a418
1 changed files with 28 additions and 41 deletions
|
@ -89,55 +89,45 @@ class sendmail::client inherits sendmail::common {
|
|||
# SMTP domain name.
|
||||
class sendmail::server inherits sendmail::common {
|
||||
|
||||
include procmail
|
||||
|
||||
case $operatingsystem {
|
||||
centos,redhat,ubuntu: {
|
||||
centos,redhat: {
|
||||
$sendmail_ostype = "linux"
|
||||
package { ["procmail"]:
|
||||
ensure => installed,
|
||||
}
|
||||
file { "/etc/mail/sendmail.mc":
|
||||
ensure => present,
|
||||
content => template("sendmail/sendmail.mc.erb"),
|
||||
owner => "root",
|
||||
group => "root",
|
||||
mode => 0644,
|
||||
notify => Exec["make sendmail.cf"],
|
||||
}
|
||||
file { "/etc/aliases":
|
||||
ensure => present,
|
||||
notify => Exec["newaliases"],
|
||||
owner => "root",
|
||||
group => "root",
|
||||
mode => 0644,
|
||||
}
|
||||
$group = "root"
|
||||
file { "/etc/sysconfig/sendmail":
|
||||
ensure => present,
|
||||
content => "DAEMON=yes\nQUEUE=1h\n",
|
||||
owner => "root",
|
||||
group => "root",
|
||||
group => $group,
|
||||
mode => 0644,
|
||||
notify => Service["sendmail"],
|
||||
}
|
||||
} ubuntu: {
|
||||
fail("Operating system not supported.")
|
||||
} openbsd: {
|
||||
$sendmail_os_type = "openbsd"
|
||||
file { "/usr/share/sendmail/cf/sendmail.mc":
|
||||
ensure => present,
|
||||
content => template("sendmail/sendmail.mc.erb"),
|
||||
owner => "root",
|
||||
group => "bin",
|
||||
mode => 0444,
|
||||
notify => Exec["make sendmail.cf"],
|
||||
}
|
||||
file { "/etc/aliases":
|
||||
ensure => present,
|
||||
notify => Exec["newaliases"],
|
||||
owner => "root",
|
||||
group => "wheel",
|
||||
mode => 0644,
|
||||
}
|
||||
$group = "wheel"
|
||||
}
|
||||
}
|
||||
|
||||
file { "sendmail.mc": name => $operatingsystem ? {
|
||||
"openbsd" => "/usr/share/sendmail/cf/sendmail.mc",
|
||||
default => "/etc/mail/sendmail.mc", },
|
||||
content => template("sendmail/sendmail.mc.erb"),
|
||||
owner => "root",
|
||||
group => $group,
|
||||
mode => 0644,
|
||||
notify => Exec["make sendmail.cf"],
|
||||
}
|
||||
|
||||
file { "/etc/aliases":
|
||||
ensure => present,
|
||||
notify => Exec["newaliases"],
|
||||
owner => "root",
|
||||
group => $group,
|
||||
mode => 0644,
|
||||
}
|
||||
|
||||
exec { "make sendmail.cf":
|
||||
path => "/bin:/usr/bin:/sbin:/usr/sbin",
|
||||
cwd => $operatingsystem ? {
|
||||
|
@ -154,10 +144,7 @@ class sendmail::server inherits sendmail::common {
|
|||
file { "/etc/mail/sendmail.cf":
|
||||
ensure => present,
|
||||
owner => "root",
|
||||
group => $operatingsystem ? {
|
||||
openbsd => "wheel",
|
||||
default => "root",
|
||||
},
|
||||
group => $group,
|
||||
mode => 0644,
|
||||
source => $operatingsystem ? {
|
||||
openbsd => "/usr/share/sendmail/cf/sendmail.cf",
|
||||
|
@ -175,6 +162,6 @@ class sendmail::server inherits sendmail::common {
|
|||
|
||||
exec { "newaliases":
|
||||
path => "/bin:/usr/bin:/sbin:/usr/sbin",
|
||||
refreshonly => true,
|
||||
refreshonly => true,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue