Merge tmakinen/puppet

Conflicts:
	dovecot/manifests/init.pp
	libvirt/manifests/init.pp
	munin/manifests/init.pp
	puppet/manifests/init.pp
	tftp/manifests/init.pp
This commit is contained in:
Ossi Salmi 2012-11-16 19:40:31 +02:00
commit 98767cfb2a
45 changed files with 5517 additions and 156 deletions

View file

@ -1,3 +1,6 @@
import "dovecot1.pp" # Dovecot v1.x
import "dovecot2.pp" # Dovecot v2.x
class dovecot::common {
case $::operatingsystem {
@ -24,79 +27,33 @@ class dovecot::common {
# Puppet source for the X.509 key.
# $dovecot_ssl_ca:
# Puppet source for the optional X.509 ca certificate.
# $dovecot_mailbox_format:
# Mailbox format to use in user's homedir ["mbox" | "mdbox"]
# $dovecot_zlib:
# Compress mailboxes with zlib ["yes" | "no"]
class dovecot::server inherits dovecot::common {
if ! $dovecot_mailbox_format {
$dovecot_mailbox_format = "mbox"
}
case $::operatingsystem {
"centos","redhat","fedora": {
$dovecot_ssl_dir = "/etc/pki/tls"
case $operatingsystemrelease {
/^6\./: {
include dovecot::server::v2
}
default: {
include dovecot::server::v1
}
}
}
default: {
fail("Dovecot module not supported in ${::operatingsystem}.")
}
}
service { "dovecot":
ensure => running,
enable => true,
require => File["/etc/dovecot.conf"],
}
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.")
}
file { "/etc/dovecot.conf":
ensure => present,
content => template("dovecot/dovecot.conf.erb"),
mode => "0644",
owner => "root",
group => "root",
notify => Service["dovecot"],
}
}