summaryrefslogtreecommitdiff
path: root/manifests/sympa.pp
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2013-01-21 18:01:00 -0200
committerSilvio Rhatto <rhatto@riseup.net>2013-01-21 18:01:00 -0200
commit86515e9a0f27d36e38faee05beb03cbb99677e73 (patch)
tree355b620ee9ea98be6d54f87c506b64b2024c8076 /manifests/sympa.pp
parent14d954ff02564493192fe1fc9ad3a148ba20ef60 (diff)
downloadpuppet-mail-86515e9a0f27d36e38faee05beb03cbb99677e73.tar.gz
puppet-mail-86515e9a0f27d36e38faee05beb03cbb99677e73.tar.bz2
Refactoring for 2.7 compatibility
Diffstat (limited to 'manifests/sympa.pp')
-rw-r--r--manifests/sympa.pp42
1 files changed, 17 insertions, 25 deletions
diff --git a/manifests/sympa.pp b/manifests/sympa.pp
index 5b042d5..0ba7841 100644
--- a/manifests/sympa.pp
+++ b/manifests/sympa.pp
@@ -1,35 +1,27 @@
class mail::sympa {
- # Sympa subsystems
- include mail::web::sympa
- include mail::packages::sympa
-
# Class configuration
- case $sympa_database_password {
- '': { fail("You need to define \$sympa_database_password host config") }
- }
-
- case $sympa_database_name {
- '': { $sympa_database_name= "sympa" }
- }
+ $database_password = hiera('sympa_database_password', '')
+ $database_name = hiera('sympa_database_name', 'sympa')
+ $database_host = hiera('sympa_database_host', 'localhost')
+ $listmasters = hiera('sympa_listmasters', "listmaster@${fqdn}")
+ $lang = hiera('sympa_lang', 'en_US')
+ $subdomain = hiera('sympa_subdomain', 'lists')
+ $logo_html_definition = hiera('sympa_logo_html_definition', '')
- case $sympa_database_host {
- '': { $sympa_database_host = "localhost" }
+ case $database_password {
+ '': { fail("You need to define database_password host config") }
}
- case $sympa_listmasters {
- '': { $sympa_listmasters = "listmaster@${fqdn}" }
- }
-
- case $sympa_lang {
- '': { $sympa_lang = "en_US" }
- }
+ # Sympa subsystems
+ include mail::web::sympa
+ include mail::packages::sympa
#
# Database configuration
#
- database::instance { "$sympa_database_name":
- password => "$sympa_database_password",
- privileges => $lsbdistcodename ? {
+ database::instance { "${database_name}":
+ password => "${database_password}",
+ privileges => $::lsbdistcodename ? {
'lenny' => 'all',
default => [ 'alter_priv', 'alter_routine_priv', 'create_priv',
'create_routine_priv', 'create_tmp_table_priv',
@@ -70,7 +62,7 @@ class mail::sympa {
owner => sympa,
group => sympa,
mode => 0640,
- content => template("mail/sympa/sympa.conf.${lsbdistcodename}.erb"),
+ content => template("mail/sympa/sympa.conf.${::lsbdistcodename}.erb"),
require => [ File['/etc/sympa'], User['sympa'] ],
notify => Service['apache', 'sympa'],
}
@@ -87,7 +79,7 @@ class mail::sympa {
owner => root,
group => root,
mode => 0600,
- content => template("mail/sympa/dbconfig-common.${lsbdistcodename}.erb"),
+ content => template("mail/sympa/dbconfig-common.${::lsbdistcodename}.erb"),
require => File['/etc/dbconfig-common'],
}