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

View file

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