cyrus: Started working on a basic support for cyrus imapd.
This commit is contained in:
parent
e3b91bb844
commit
79ca80a4a2
3 changed files with 489 additions and 0 deletions
80
cyrus/manifests/init.pp
Normal file
80
cyrus/manifests/init.pp
Normal file
|
@ -0,0 +1,80 @@
|
|||
# By default we want to run an IMAP(s) server and disabled pop3 + nntp.
|
||||
#
|
||||
# $cyrus_key:
|
||||
# Path to SSL private key. Defaults to puppet client key.
|
||||
#
|
||||
# $cyrus_cert:
|
||||
# Path to SSL certificate. Defaults to puppet client certificate.
|
||||
#
|
||||
class cyrus {
|
||||
|
||||
case $::operatingsystem {
|
||||
"ubuntu","debian": {}
|
||||
default: {
|
||||
fail("cyrus not supported on ${::operatingsystem}")
|
||||
}
|
||||
}
|
||||
|
||||
include ssl
|
||||
|
||||
if !$cyrus_key {
|
||||
$postfix_key = "${puppet_ssldir}/private_keys/${homename}.pem"
|
||||
}
|
||||
|
||||
if !$cyrus_cert {
|
||||
$postfix_cert = "${puppet_ssldir}/certs/${homename}.pem"
|
||||
}
|
||||
|
||||
package { [
|
||||
"cyrus-imapd-2.4",
|
||||
"cyrus-clients-2.4",
|
||||
"cyrus-admin-2.4",
|
||||
"cyrus-doc-2.4", ]:
|
||||
ensure => present,
|
||||
}
|
||||
|
||||
service { "cyrus-imapd":
|
||||
ensure => running,
|
||||
enable => true,
|
||||
require => Package["cyrus-imapd-2.4"],
|
||||
}
|
||||
|
||||
file { "${ssl::certs}/cyrus.crt":
|
||||
ensure => present,
|
||||
source => $cyrus_cert,
|
||||
mode => "0644",
|
||||
owner => "root",
|
||||
group => "root",
|
||||
notify => Service["cyrus-imapd"],
|
||||
}
|
||||
|
||||
file { "${ssl::private}/cyrus.key":
|
||||
ensure => present,
|
||||
source => $cyrus_key,
|
||||
mode => "0600",
|
||||
owner => "root",
|
||||
group => "root",
|
||||
notify => Service["cyrus-imapd"],
|
||||
}
|
||||
|
||||
file { "/etc/cyrus.conf":
|
||||
ensure => present,
|
||||
mode => "0644",
|
||||
owner => "root",
|
||||
group => "root",
|
||||
source => "puppet:///files/cyrus.conf"
|
||||
notify => Service["cyrus-imapd"],
|
||||
require => Package["cyrus-imapd-2.4"],
|
||||
}
|
||||
|
||||
file { "/etc/imapd.conf":
|
||||
ensure => present,
|
||||
mode => "0644",
|
||||
owner => "root",
|
||||
group => "root",
|
||||
content => template("cyrus/imapd.conf.erb"),
|
||||
notify => Service["cyrus-imapd"],
|
||||
require => Package["cyrus-imapd-2.4"],
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue