dovecot: use ssl module for certificate paths
This commit is contained in:
parent
ede7c42a11
commit
22c06c3ee3
2 changed files with 32 additions and 43 deletions
|
@ -39,15 +39,6 @@ class dovecot::server inherits dovecot::common {
|
|||
$dovecot_mailbox_format = "mbox"
|
||||
}
|
||||
|
||||
case $operatingsystem {
|
||||
centos,fedora: {
|
||||
$dovecot_ssl_dir = "/etc/pki/tls"
|
||||
}
|
||||
default: {
|
||||
fail("Dovecot module not supported in ${operatingsystem}.")
|
||||
}
|
||||
}
|
||||
|
||||
service { "dovecot":
|
||||
ensure => running,
|
||||
enable => true,
|
||||
|
@ -76,8 +67,33 @@ class dovecot::server inherits dovecot::common {
|
|||
require => Package["dovecot"],
|
||||
}
|
||||
|
||||
|
||||
if ! ($dovecot_ssl_key and $dovecot_ssl_cert) {
|
||||
fail("Must define \$dovecot_ssl_key and \$dovecot_ssl_cert")
|
||||
}
|
||||
|
||||
include ssl
|
||||
|
||||
file { "${ssl::private}/dovecot.key":
|
||||
ensure => present,
|
||||
source => $dovecot_ssl_key,
|
||||
mode => "0600",
|
||||
owner => "root",
|
||||
group => "root",
|
||||
notify => Service["dovecot"],
|
||||
}
|
||||
|
||||
file { "${ssl::certs}/dovecot.crt":
|
||||
ensure => present,
|
||||
source => $dovecot_ssl_cert,
|
||||
mode => "0644",
|
||||
owner => "root",
|
||||
group => "root",
|
||||
notify => Service["dovecot"],
|
||||
}
|
||||
|
||||
if $dovecot_ssl_csr {
|
||||
file { "$dovecot_ssl_dir/private/dovecot.csr":
|
||||
file { "${ssl::private}/dovecot.csr":
|
||||
ensure => present,
|
||||
source => $dovecot_ssl_csr,
|
||||
mode => "0640",
|
||||
|
@ -88,7 +104,7 @@ class dovecot::server inherits dovecot::common {
|
|||
}
|
||||
|
||||
if $dovecot_ssl_ca {
|
||||
file { "$dovecot_ssl_dir/certs/dovecot.ca.crt":
|
||||
file { "${ssl::certs}/dovecot.ca.crt":
|
||||
ensure => present,
|
||||
source => $dovecot_ssl_ca,
|
||||
mode => "0644",
|
||||
|
@ -98,32 +114,6 @@ class dovecot::server inherits dovecot::common {
|
|||
}
|
||||
}
|
||||
|
||||
if $dovecot_ssl_cert {
|
||||
file { "$dovecot_ssl_dir/certs/dovecot.crt":
|
||||
ensure => present,
|
||||
source => $dovecot_ssl_cert,
|
||||
mode => "0644",
|
||||
owner => "root",
|
||||
group => "root",
|
||||
notify => Service["dovecot"],
|
||||
}
|
||||
} else {
|
||||
fail("You need to define an ssl_cert in your node manifest.")
|
||||
}
|
||||
|
||||
if $dovecot_ssl_key {
|
||||
file { "$dovecot_ssl_dir/private/dovecot.key":
|
||||
ensure => present,
|
||||
source => $dovecot_ssl_key,
|
||||
mode => "0600",
|
||||
owner => "root",
|
||||
group => "root",
|
||||
notify => Service["dovecot"],
|
||||
}
|
||||
} else {
|
||||
fail("You need to define an ssl_key in your node manifest.")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue