hastymail: Added datadir parameter
This commit is contained in:
parent
20e9361e20
commit
7af13184e8
1 changed files with 53 additions and 17 deletions
|
@ -1,20 +1,16 @@
|
||||||
|
# Install and configure Hastymail.
|
||||||
|
#
|
||||||
|
# === Parameters
|
||||||
|
#
|
||||||
|
# $datadir:
|
||||||
|
# Data directory. Defaults to /srv/hastymail.
|
||||||
|
#
|
||||||
|
class hastymail($datadir=undef) {
|
||||||
|
|
||||||
class hastymail {
|
include php::cli
|
||||||
|
include php::imap
|
||||||
case $::operatingsystem {
|
include php::ldap
|
||||||
"ubuntu","debian": {
|
include php::mcrypt
|
||||||
package { ["php5", "php5-cli", "php5-common",
|
|
||||||
"php5-imap", "php5-ldap", "php5-mcrypt"]:
|
|
||||||
ensure => installed,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
"centos","redhat","fedora": {
|
|
||||||
|
|
||||||
}
|
|
||||||
default: {
|
|
||||||
fail("cyrus not supported on ${::operatingsystem}")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if !$hastymail_package {
|
if !$hastymail_package {
|
||||||
if $hastymail_package_latest {
|
if $hastymail_package_latest {
|
||||||
|
@ -24,6 +20,47 @@ class hastymail {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if $datadir {
|
||||||
|
file { $datadir:
|
||||||
|
ensure => directory,
|
||||||
|
mode => "0750",
|
||||||
|
owner => "root",
|
||||||
|
group => $apache::sslserver::group,
|
||||||
|
seltype => "httpd_sys_rw_content_t",
|
||||||
|
}
|
||||||
|
selinux::manage_fcontext { "${datadir}(/.*)?":
|
||||||
|
type => "httpd_sys_rw_content_t",
|
||||||
|
before => File[$datadir],
|
||||||
|
}
|
||||||
|
file { "/srv/hastymail":
|
||||||
|
ensure => link,
|
||||||
|
target => $datadir,
|
||||||
|
seltype => "httpd_sys_rw_content_t",
|
||||||
|
require => File[$datadir],
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
file { "/srv/hastymail":
|
||||||
|
ensure => directory,
|
||||||
|
mode => "0750",
|
||||||
|
owner => "root",
|
||||||
|
group => $apache::sslserver::group,
|
||||||
|
seltype => "httpd_sys_rw_content_t",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
selinux::manage_fcontext { "/srv/hastymail(/.*)?":
|
||||||
|
type => "httpd_sys_rw_content_t",
|
||||||
|
before => File["/srv/hastymail"],
|
||||||
|
}
|
||||||
|
|
||||||
|
file { [ "/srv/hastymail/attachments",
|
||||||
|
"/srv/hastymail/settings", ]:
|
||||||
|
ensure => directory,
|
||||||
|
mode => "0770",
|
||||||
|
owner => "root",
|
||||||
|
group => $apache::sslserver::group,
|
||||||
|
seltype => "httpd_sys_rw_content_t",
|
||||||
|
}
|
||||||
|
|
||||||
file { "/usr/local/src/hastymail.tar.gz":
|
file { "/usr/local/src/hastymail.tar.gz":
|
||||||
ensure => present,
|
ensure => present,
|
||||||
source => "puppet:///files/packages/${hastymail_package}",
|
source => "puppet:///files/packages/${hastymail_package}",
|
||||||
|
@ -68,4 +105,3 @@ class hastymail {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue