diff options
author | Nicolas Vigier <boklm@mageia.org> | 2013-04-22 17:14:25 +0000 |
---|---|---|
committer | Nicolas Vigier <boklm@mageia.org> | 2013-04-22 17:14:25 +0000 |
commit | 0f5eb63dc507635367d8f2a5d9e175d2e9c3faf5 (patch) | |
tree | fbab99d4053c047f783e7410655e4a0ca1c88a94 | |
parent | de0e65f6ed000d72fff695345f304e9d042c26e6 (diff) | |
download | puppet-0f5eb63dc507635367d8f2a5d9e175d2e9c3faf5.tar puppet-0f5eb63dc507635367d8f2a5d9e175d2e9c3faf5.tar.gz puppet-0f5eb63dc507635367d8f2a5d9e175d2e9c3faf5.tar.bz2 puppet-0f5eb63dc507635367d8f2a5d9e175d2e9c3faf5.tar.xz puppet-0f5eb63dc507635367d8f2a5d9e175d2e9c3faf5.zip |
sympa: merge sender_email and sender_ldap_group scenarios
So that it's possible to have both on one ML.
-rw-r--r-- | modules/sympa/manifests/list.pp | 11 | ||||
-rw-r--r-- | modules/sympa/manifests/scenario/sender_email.pp | 5 | ||||
-rw-r--r-- | modules/sympa/manifests/scenario/sender_ldap_group.pp | 7 | ||||
-rw-r--r-- | modules/sympa/manifests/scenario/sender_restricted.pp | 8 | ||||
-rw-r--r-- | modules/sympa/templates/scenari/sender.ldap_group | 5 | ||||
-rw-r--r-- | modules/sympa/templates/scenari/sender.restricted (renamed from modules/sympa/templates/scenari/sender.email) | 7 |
6 files changed, 17 insertions, 26 deletions
diff --git a/modules/sympa/manifests/list.pp b/modules/sympa/manifests/list.pp index e660b38c..43001239 100644 --- a/modules/sympa/manifests/list.pp +++ b/modules/sympa/manifests/list.pp @@ -34,15 +34,10 @@ define sympa::list( $subject, notify => Service['sympa'], } - if $sender_ldap_group { - sympa::scenario::sender_ldap_group { $name: + if $sender_ldap_group or $sender_email { + sympa::scenario::sender_restricted { $name: ldap_group => $sender_ldap_group, - } - } - - if $sender_email { - sympa::scenario::sender_email { $name: - email => $sender_email, + email => $sender_email, } } diff --git a/modules/sympa/manifests/scenario/sender_email.pp b/modules/sympa/manifests/scenario/sender_email.pp deleted file mode 100644 index 7f4bc688..00000000 --- a/modules/sympa/manifests/scenario/sender_email.pp +++ /dev/null @@ -1,5 +0,0 @@ -define sympa::scenario::sender_email($email) { - file { "/etc/sympa/scenari/send.restricted_$name": - content => template('sympa/scenari/sender.email') - } -} diff --git a/modules/sympa/manifests/scenario/sender_ldap_group.pp b/modules/sympa/manifests/scenario/sender_ldap_group.pp deleted file mode 100644 index 70915080..00000000 --- a/modules/sympa/manifests/scenario/sender_ldap_group.pp +++ /dev/null @@ -1,7 +0,0 @@ -define sympa::scenario::sender_ldap_group($ldap_group) { - file { "/etc/sympa/scenari/send.restricted_$name": - content => template('sympa/scenari/sender.ldap_group') - } -} - - diff --git a/modules/sympa/manifests/scenario/sender_restricted.pp b/modules/sympa/manifests/scenario/sender_restricted.pp new file mode 100644 index 00000000..48e2d459 --- /dev/null +++ b/modules/sympa/manifests/scenario/sender_restricted.pp @@ -0,0 +1,8 @@ +define sympa::scenario::sender_restricted( + $email = false, + $ldap_group = false +) { + file { "/etc/sympa/scenari/send.restricted_$name": + content => template('sympa/scenari/sender.restricted') + } +} diff --git a/modules/sympa/templates/scenari/sender.ldap_group b/modules/sympa/templates/scenari/sender.ldap_group deleted file mode 100644 index ac8b3fd9..00000000 --- a/modules/sympa/templates/scenari/sender.ldap_group +++ /dev/null @@ -1,5 +0,0 @@ -title.gettext restricted to group <%= @ldap_group %> - -search(<%= @ldap_group %>.ldap) smtp,md5,smime -> do_it -true() smtp,md5,smime -> reject(reason='send_subscriber') - diff --git a/modules/sympa/templates/scenari/sender.email b/modules/sympa/templates/scenari/sender.restricted index 18704f48..69da52c5 100644 --- a/modules/sympa/templates/scenari/sender.email +++ b/modules/sympa/templates/scenari/sender.restricted @@ -1,7 +1,12 @@ title.gettext restricted list -<%- for e in @email -%> +<%- if @ldap_group -%> +search(<%= @ldap_group %>.ldap) smtp,md5,smime -> do_it +<%- end -%> +<%- if @email -%> + <%- for e in @email -%> equal([sender], '<%= e %>') smtp,md5,smime -> do_it + <%- end -%> <%- end -%> true() smtp,md5,smime -> reject(reason='send_subscriber') |