Fixed sendmail startup on CentOS.

This commit is contained in:
Timo Mkinen 2011-12-14 13:27:57 +02:00
parent 3d214a726a
commit f10fd7098e

View file

@ -11,6 +11,24 @@ class sendmail::common {
name => [ "sendmail", "sendmail-cf", ], name => [ "sendmail", "sendmail-cf", ],
ensure => installed, ensure => installed,
} }
service { "sendmail":
ensure => running,
enable => true,
require => Package["sendmail"],
}
}
case $operatingsystem {
"centos","fedora": {
file { "/etc/sysconfig/sendmail":
ensure => present,
content => "DAEMON=no\nQUEUE=1h\n",
owner => "root",
group => "root",
mode => 0644,
notify => Service["sendmail"],
}
}
} }
} }
@ -60,6 +78,10 @@ class sendmail::client inherits sendmail::common {
default => "/etc/mail", default => "/etc/mail",
}, },
refreshonly => true, refreshonly => true,
notify => $operatingsystem ? {
"openbsd" => undef,
default => Service["sendmail"],
},
} }
file { "/etc/mail/submit.cf": file { "/etc/mail/submit.cf":
@ -92,13 +114,8 @@ class sendmail::server inherits sendmail::common {
centos,redhat: { centos,redhat: {
$sendmail_ostype = "linux" $sendmail_ostype = "linux"
$group = "root" $group = "root"
file { "/etc/sysconfig/sendmail": File["/etc/sysconfig/sendmail"] {
ensure => present,
content => "DAEMON=yes\nQUEUE=1h\n", content => "DAEMON=yes\nQUEUE=1h\n",
owner => "root",
group => $group,
mode => 0644,
notify => Service["sendmail"],
} }
} ubuntu: { } ubuntu: {
fail("Operating system not supported.") fail("Operating system not supported.")
@ -152,12 +169,6 @@ class sendmail::server inherits sendmail::common {
notify => Service["sendmail"], notify => Service["sendmail"],
} }
service { "sendmail":
ensure => running,
enable => true,
require => File["/etc/mail/sendmail.cf"],
}
exec { "newaliases": exec { "newaliases":
path => "/bin:/usr/bin:/sbin:/usr/sbin", path => "/bin:/usr/bin:/sbin:/usr/sbin",
refreshonly => true, refreshonly => true,