diff options
Diffstat (limited to 'manifests/sympa.pp')
-rw-r--r-- | manifests/sympa.pp | 42 |
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'], } |