Initial support for Dovecot 2.x versions.
This commit is contained in:
parent
2390603711
commit
95fe49abe7
4 changed files with 206 additions and 63 deletions
75
dovecot/manifests/dovecot2.pp
Normal file
75
dovecot/manifests/dovecot2.pp
Normal file
|
@ -0,0 +1,75 @@
|
|||
|
||||
class dovecot::server::v2 {
|
||||
case $operatingsystem {
|
||||
centos,fedora: {
|
||||
$dovecot_ssl_dir = "/etc/pki/tls"
|
||||
}
|
||||
default: {
|
||||
fail("Dovecot module not supported in ${operatingsystem}.")
|
||||
}
|
||||
}
|
||||
|
||||
service { "dovecot":
|
||||
ensure => running,
|
||||
enable => true,
|
||||
require => File["/etc/dovecot/conf.d/99-local.conf"],
|
||||
}
|
||||
|
||||
file { "/etc/dovecot/conf.d/99-local.conf":
|
||||
ensure => present,
|
||||
content => template("dovecot/local.conf.erb"),
|
||||
mode => "0644",
|
||||
owner => "root",
|
||||
group => "root",
|
||||
notify => Service["dovecot"],
|
||||
require => Package["dovecot"],
|
||||
}
|
||||
|
||||
if $dovecot_ssl_csr {
|
||||
file { "$dovecot_ssl_dir/private/dovecot.csr":
|
||||
ensure => present,
|
||||
source => $dovecot_ssl_csr,
|
||||
mode => "0640",
|
||||
owner => "root",
|
||||
group => "root",
|
||||
notify => Service["dovecot"],
|
||||
}
|
||||
}
|
||||
|
||||
if $dovecot_ssl_ca {
|
||||
file { "$dovecot_ssl_dir/certs/dovecot.ca.crt":
|
||||
ensure => present,
|
||||
source => $dovecot_ssl_ca,
|
||||
mode => "0644",
|
||||
owner => "root",
|
||||
group => "root",
|
||||
notify => Service["dovecot"],
|
||||
}
|
||||
}
|
||||
|
||||
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