Added Ubuntu support for sendmail::client class.

This commit is contained in:
Timo Mkinen 2011-05-18 12:37:00 +03:00
parent b2bce840c9
commit 9a90aa13ab
2 changed files with 19 additions and 19 deletions

View file

@ -6,11 +6,10 @@ class sendmail::common {
$mail_domain = $domain
}
case $operatingsystem {
centos,fedora: {
package { ["sendmail", "sendmail-cf"]:
ensure => installed,
}
if $operatingsystem != "openbsd" {
package { "sendmail":
name => [ "sendmail", "sendmail-cf", ],
ensure => installed,
}
}
@ -31,7 +30,7 @@ class sendmail::client inherits sendmail::common {
}
case $operatingsystem {
openbsd: {
"openbsd": {
file { "/usr/share/sendmail/cf/submit.mc":
ensure => present,
content => template("sendmail/submit.mc.erb"),
@ -49,6 +48,7 @@ class sendmail::client inherits sendmail::common {
group => "root",
mode => 0644,
notify => Exec["make submit.cf"],
require => Package["sendmail"],
}
}
}
@ -56,12 +56,8 @@ class sendmail::client inherits sendmail::common {
exec { "make submit.cf":
path => "/bin:/usr/bin:/sbin:/usr/sbin",
cwd => $operatingsystem ? {
openbsd => "/usr/share/sendmail/cf",
default => "/etc/mail",
},
require => $operatingsystem ? {
openbsd => undef,
default => Package["sendmail-cf"],
"openbsd" => "/usr/share/sendmail/cf",
default => "/etc/mail",
},
refreshonly => true,
}
@ -70,13 +66,14 @@ class sendmail::client inherits sendmail::common {
ensure => present,
owner => "root",
group => $operatingsystem ? {
openbsd => "wheel",
default => "root",
"openbsd" => "wheel",
"ubuntu" => "smmsp",
default => "root",
},
mode => 0644,
source => $operatingsystem ? {
openbsd => "/usr/share/sendmail/cf/submit.cf",
default => undef,
"openbsd" => "/usr/share/sendmail/cf/submit.cf",
default => undef,
},
require => Exec["make submit.cf"],
}
@ -137,7 +134,7 @@ class sendmail::server inherits sendmail::common {
},
require => $operatingsystem ? {
openbsd => undef,
default => Package["sendmail-cf"],
default => Package["sendmail"],
},
refreshonly => true,
}

View file

@ -15,8 +15,11 @@ divert(-1)
#
divert(0)dnl
<% if kernel == 'Linux' -%>
<% if ['CentOS','Fedora'].index(operatingsystem) -%>
include(`/usr/share/sendmail-cf/m4/cf.m4')dnl
<% elsif operatingsystem == 'Ubuntu' -%>
include(`/usr/share/sendmail/cf/m4/cf.m4')dnl
DOMAIN(`debian-msp')dnl
<% end -%>
VERSIONID(`puppet setup')dnl
define(`confCF_VERSION', `Submit')dnl
@ -28,7 +31,7 @@ define(`confDIRECT_SUBMISSION_MODIFIERS',`C')dnl
<% if has_variable?('mail_domain') -%>
define(`confDOMAIN_NAME', `<%= mail_domain %>')dnl
<% end -%>
<% if kernel == 'Linux' -%>
<% if ['CentOS','Fedora'].index(operatingsystem) -%>
define(`confPID_FILE', `/var/run/sm-client.pid')dnl
<% end -%>
FEATURE(`use_ct_file')dnl