From f10fd7098e3e708e8dd0bbd9a17d920775cce4cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20M=E4kinen?= Date: Wed, 14 Dec 2011 13:27:57 +0200 Subject: [PATCH] Fixed sendmail startup on CentOS. --- sendmail/manifests/init.pp | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/sendmail/manifests/init.pp b/sendmail/manifests/init.pp index f66d5d8..17ce84e 100644 --- a/sendmail/manifests/init.pp +++ b/sendmail/manifests/init.pp @@ -11,6 +11,24 @@ class sendmail::common { name => [ "sendmail", "sendmail-cf", ], 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", }, refreshonly => true, + notify => $operatingsystem ? { + "openbsd" => undef, + default => Service["sendmail"], + }, } file { "/etc/mail/submit.cf": @@ -92,13 +114,8 @@ class sendmail::server inherits sendmail::common { centos,redhat: { $sendmail_ostype = "linux" $group = "root" - file { "/etc/sysconfig/sendmail": - ensure => present, + File["/etc/sysconfig/sendmail"] { content => "DAEMON=yes\nQUEUE=1h\n", - owner => "root", - group => $group, - mode => 0644, - notify => Service["sendmail"], } } ubuntu: { fail("Operating system not supported.") @@ -152,12 +169,6 @@ class sendmail::server inherits sendmail::common { notify => Service["sendmail"], } - service { "sendmail": - ensure => running, - enable => true, - require => File["/etc/mail/sendmail.cf"], - } - exec { "newaliases": path => "/bin:/usr/bin:/sbin:/usr/sbin", refreshonly => true,