diff --git a/manifests/init.pp b/manifests/init.pp index bf2f9cf09aa6c3542dbfde87e4100382f3357415..38cec5dfbea05b9594a3ac8b1293b4f7bfa33fb8 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -17,7 +17,7 @@ # @param listdomain # Primary mail domain name. Web interface for Sympa mailing list manager, can # be joined at https://$listdomain -# @param listmaster Email addresses of listmaster +# @param listmaster Email addresses of listmasters # @param lang Supported language # @param topics Defines topics (categories) of the mailing lists. # @@ -37,7 +37,7 @@ class sympa ( String[1] $aliases_file = 'sympa_aliases', String[1] $release = '6.2.74', Stdlib::Fqdn $listdomain = 'listes.example.org', - Stdlib::Email $listmaster = 'listmaster@example.org', + Array[Stdlib::Email] $listmaster = ['listmaster@example.org'], Enum['fr'] $lang = 'fr', Sympa::Topics $topics = {}, ) { diff --git a/spec/classes/sympa_spec.rb b/spec/classes/sympa_spec.rb index 11fa094564e3578ad935fe8dc61d236606ec8c5c..292dad4a0869372b6dad4fa4e692dfd7af90ac12 100644 --- a/spec/classes/sympa_spec.rb +++ b/spec/classes/sympa_spec.rb @@ -28,6 +28,34 @@ describe 'sympa' do it { is_expected.to compile.with_all_deps } end + + context 'with only one listmaster email address' do + let(:params) do + { + listmaster: ['lm1@example.com'], + } + end + + it { is_expected.to compile.with_all_deps } + it do + is_expected.to contain_file('/home/sympa/etc/sympa.conf') \ + .with_content(%r{^listmaster\s+lm1@example\.com$}) + end + end + + context 'with several listmaster email addresses' do + let(:params) do + { + listmaster: ['lm1@example.com', 'lm2@example.com'], + } + end + + it { is_expected.to compile.with_all_deps } + it do + is_expected.to contain_file('/home/sympa/etc/sympa.conf') \ + .with_content(%r{^listmaster\s+lm1@example\.com,lm2@example\.com$}) + end + end end end end diff --git a/templates/sympa.conf.epp b/templates/sympa.conf.epp index f45a1b1628f83e58471468ac51716effe3415450..e11f7fa6f9c993804a5dc1fecb2add65054de023 100644 --- a/templates/sympa.conf.epp +++ b/templates/sympa.conf.epp @@ -4,7 +4,7 @@ ######################################################################## domain <%= $sympa::listdomain %> -listmaster <%= $sympa::listmaster %> +listmaster <%= $sympa::listmaster.join(',') %> lang <%= $sympa::lang %> ########################################################################