sendmail: Use ssl module for certificate paths, kernel fact for ostype
This commit is contained in:
parent
65ef51f9dd
commit
7904109460
3 changed files with 15 additions and 16 deletions
|
@ -29,15 +29,12 @@ class sendmail::common {
|
||||||
mode => "0644",
|
mode => "0644",
|
||||||
notify => Service["sendmail"],
|
notify => Service["sendmail"],
|
||||||
}
|
}
|
||||||
$ostype = "linux"
|
|
||||||
$cabundle = "/etc/pki/tls/certs/ca-bundle.crt"
|
$cabundle = "/etc/pki/tls/certs/ca-bundle.crt"
|
||||||
}
|
}
|
||||||
"ubuntu","debian": {
|
"ubuntu","debian": {
|
||||||
$ostype = "linux"
|
|
||||||
$cabundle = "/etc/ssl/certs/ca-certificates.crt"
|
$cabundle = "/etc/ssl/certs/ca-certificates.crt"
|
||||||
}
|
}
|
||||||
"openbsd": {
|
"openbsd": {
|
||||||
$ostype = "openbsd"
|
|
||||||
$cabundle = "/etc/ssl/cert.pem"
|
$cabundle = "/etc/ssl/cert.pem"
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
|
@ -245,29 +242,31 @@ class sendmail::server inherits sendmail::common {
|
||||||
$ssl_chain = basename($sendmail_ssl_chain)
|
$ssl_chain = basename($sendmail_ssl_chain)
|
||||||
}
|
}
|
||||||
|
|
||||||
file { "/etc/pki/tls/private/${ssl_key}":
|
include ssl
|
||||||
|
|
||||||
|
file { "${ssl::private}/${ssl_key}":
|
||||||
ensure => present,
|
ensure => present,
|
||||||
source => $sendmail_ssl_key,
|
|
||||||
mode => "0600",
|
mode => "0600",
|
||||||
owner => "root",
|
owner => "root",
|
||||||
group => "root",
|
group => "root",
|
||||||
|
source => $sendmail_ssl_key,
|
||||||
notify => Service["sendmail"],
|
notify => Service["sendmail"],
|
||||||
}
|
}
|
||||||
file { "/etc/pki/tls/certs/${ssl_cert}":
|
file { "${ssl::certs}/${ssl_cert}":
|
||||||
ensure => present,
|
ensure => present,
|
||||||
source => $sendmail_ssl_cert,
|
|
||||||
mode => "0644",
|
mode => "0644",
|
||||||
owner => "root",
|
owner => "root",
|
||||||
group => "root",
|
group => "root",
|
||||||
|
source => $sendmail_ssl_cert,
|
||||||
notify => Service["sendmail"],
|
notify => Service["sendmail"],
|
||||||
}
|
}
|
||||||
if $ssl_chain {
|
if $ssl_chain {
|
||||||
file { "/etc/pki/tls/certs/${ssl_chain}":
|
file { "${ssl::certs}/${ssl_chain}":
|
||||||
ensure => present,
|
ensure => present,
|
||||||
source => $sendmail_ssl_chain,
|
|
||||||
mode => "0644",
|
mode => "0644",
|
||||||
owner => "root",
|
owner => "root",
|
||||||
group => "root",
|
group => "root",
|
||||||
|
source => $sendmail_ssl_chain,
|
||||||
notify => Service["sendmail"],
|
notify => Service["sendmail"],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@ include(`/usr/share/sendmail-cf/m4/cf.m4')dnl
|
||||||
include(`/usr/share/sendmail/cf/m4/cf.m4')dnl
|
include(`/usr/share/sendmail/cf/m4/cf.m4')dnl
|
||||||
<% end -%>
|
<% end -%>
|
||||||
VERSIONID(`puppet sendmail::server')dnl
|
VERSIONID(`puppet sendmail::server')dnl
|
||||||
OSTYPE(`<%= @ostype -%>')dnl
|
OSTYPE(`<%= @kernel.downcase -%>')dnl
|
||||||
dnl #
|
dnl #
|
||||||
define(`confDEF_USER_ID', ``8:12'')dnl
|
define(`confDEF_USER_ID', ``8:12'')dnl
|
||||||
define(`confTO_CONNECT', `1m')dnl
|
define(`confTO_CONNECT', `1m')dnl
|
||||||
|
@ -33,12 +33,12 @@ dnl #
|
||||||
define(`confCACERT_PATH', `/etc/mail/certs')
|
define(`confCACERT_PATH', `/etc/mail/certs')
|
||||||
<% if @ssl_key and @ssl_cert -%>
|
<% if @ssl_key and @ssl_cert -%>
|
||||||
<% if @ssl_chain -%>
|
<% if @ssl_chain -%>
|
||||||
define(`confCACERT', `/etc/pki/tls/certs/<%= @ssl_chain %>')
|
define(`confCACERT', `<%= scope.lookupvar('ssl::certs') %>/<%= @ssl_chain %>')
|
||||||
<% end -%>
|
<% end -%>
|
||||||
define(`confSERVER_CERT', `/etc/pki/tls/certs/<%= @ssl_cert %>')
|
define(`confSERVER_CERT', `<%= scope.lookupvar('ssl::certs') %>/<%= @ssl_cert %>')
|
||||||
define(`confSERVER_KEY', `/etc/pki/tls/private/<%= @ssl_key %>')
|
define(`confSERVER_KEY', `<%= scope.lookupvar('ssl::private') %>/<%= @ssl_key %>')
|
||||||
define(`confCLIENT_CERT', `/etc/pki/tls/certs/<%= @ssl_cert %>')
|
define(`confCLIENT_CERT', `<%= scope.lookupvar('ssl::certs') %>/<%= @ssl_cert %>')
|
||||||
define(`confCLIENT_KEY', `/etc/pki/tls/private/<%= @ssl_key %>')
|
define(`confCLIENT_KEY', `<%= scope.lookupvar('ssl::private') %>/<%= @ssl_key %>')
|
||||||
<% end -%>
|
<% end -%>
|
||||||
dnl #
|
dnl #
|
||||||
FEATURE(`no_default_msa', `dnl')dnl
|
FEATURE(`no_default_msa', `dnl')dnl
|
||||||
|
|
|
@ -22,7 +22,7 @@ include(`/usr/share/sendmail/cf/m4/cf.m4')dnl
|
||||||
DOMAIN(`debian-msp')dnl
|
DOMAIN(`debian-msp')dnl
|
||||||
<% end -%>
|
<% end -%>
|
||||||
VERSIONID(`puppet setup')dnl
|
VERSIONID(`puppet setup')dnl
|
||||||
OSTYPE(`<%= @ostype -%>')dnl
|
OSTYPE(`<%= @kernel.downcase -%>')dnl
|
||||||
define(`confCF_VERSION', `Submit')dnl
|
define(`confCF_VERSION', `Submit')dnl
|
||||||
define(`__OSTYPE__',`')dnl dirty hack to keep proto.m4 from complaining
|
define(`__OSTYPE__',`')dnl dirty hack to keep proto.m4 from complaining
|
||||||
define(`_USE_DECNET_SYNTAX_', `1')dnl support DECnet
|
define(`_USE_DECNET_SYNTAX_', `1')dnl support DECnet
|
||||||
|
|
Loading…
Add table
Reference in a new issue