From 9a90aa13ab365bc777f6247b8f9efe8a61eff570 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20M=E4kinen?= Date: Wed, 18 May 2011 12:37:00 +0300 Subject: [PATCH] Added Ubuntu support for sendmail::client class. --- sendmail/manifests/init.pp | 31 ++++++++++++++----------------- sendmail/templates/submit.mc.erb | 7 +++++-- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/sendmail/manifests/init.pp b/sendmail/manifests/init.pp index 9c7c659..94d2558 100644 --- a/sendmail/manifests/init.pp +++ b/sendmail/manifests/init.pp @@ -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, } diff --git a/sendmail/templates/submit.mc.erb b/sendmail/templates/submit.mc.erb index c68df7b..88187ef 100644 --- a/sendmail/templates/submit.mc.erb +++ b/sendmail/templates/submit.mc.erb @@ -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