aboutsummaryrefslogtreecommitdiffstats
path: root/modules/sympa
diff options
context:
space:
mode:
Diffstat (limited to 'modules/sympa')
-rw-r--r--modules/sympa/manifests/announce_list_email.pp16
-rw-r--r--modules/sympa/manifests/announce_list_group.pp17
-rw-r--r--modules/sympa/manifests/init.pp149
-rw-r--r--modules/sympa/manifests/list.pp62
-rw-r--r--modules/sympa/manifests/public_list.pp13
-rw-r--r--modules/sympa/manifests/public_restricted_list.pp17
-rw-r--r--modules/sympa/manifests/restricted_list.pp15
-rw-r--r--modules/sympa/manifests/restricted_list_open.pp14
8 files changed, 154 insertions, 149 deletions
diff --git a/modules/sympa/manifests/announce_list_email.pp b/modules/sympa/manifests/announce_list_email.pp
new file mode 100644
index 00000000..e93f6b59
--- /dev/null
+++ b/modules/sympa/manifests/announce_list_email.pp
@@ -0,0 +1,16 @@
+# list where announce are sent by $email only
+# reply_to is set to $reply_to
+define sympa::announce_list_email($subject,
+ $reply_to,
+ $sender_email,
+ $language = 'en',
+ $topics = false) {
+ list { $name:
+ subject => $subject,
+ profile => '',
+ language => $language,
+ topics => $topics,
+ reply_to => $reply_to,
+ sender_email => $sender_email,
+ }
+}
diff --git a/modules/sympa/manifests/announce_list_group.pp b/modules/sympa/manifests/announce_list_group.pp
new file mode 100644
index 00000000..ddb3747a
--- /dev/null
+++ b/modules/sympa/manifests/announce_list_group.pp
@@ -0,0 +1,17 @@
+# list where announce are sent by member of ldap_group
+# reply_to is set to $reply_to
+define sympa::announce_list_group($subject,
+ $reply_to,
+ $sender_ldap_group,
+ $language = 'en',
+ $topics = false) {
+ # profile + scenario
+ list { $name:
+ subject => $subject,
+ profile => '',
+ language => $language,
+ topics => $topics,
+ reply_to => $reply_to,
+ sender_ldap_group => $sender_ldap_group,
+ }
+}
diff --git a/modules/sympa/manifests/init.pp b/modules/sympa/manifests/init.pp
index 01f1de50..2ce851ea 100644
--- a/modules/sympa/manifests/init.pp
+++ b/modules/sympa/manifests/init.pp
@@ -121,153 +121,4 @@ class sympa {
owner => sympa,
}
}
-
- define list($subject,
- $profile = false,
- $language = 'en',
- $topics = false,
- $reply_to = false,
- $sender_email = false,
- $sender_ldap_group = false,
- $subscriber_ldap_group = false,
- $public_archive = true,
- $subscription_open = false) {
-
- include sympa::variable
- $ldap_password = extlookup("sympa_ldap",'x')
- $custom_subject = $name
-
- $xml_file = "/etc/sympa/lists_xml/$name.xml"
-
- if $sender_email {
- $sender_email_file = regsubst($sender_email,'\@','-at-')
- } else {
- $sender_email_file = ''
- }
-
- file { "$xml_file":
- content => template('sympa/list.xml'),
- require => Package[sympa],
- }
-
- exec { "sympa.pl --create_list --robot=$sympa::variable::vhost --input_file=$xml_file":
- require => File["$xml_file"],
- creates => "/var/lib/sympa/expl/$name",
- before => File["/var/lib/sympa/expl/$name/config"],
- }
-
- file { "/var/lib/sympa/expl/$name/config":
- owner => sympa,
- group => sympa,
- mode => 750,
- content => template("sympa/config"),
- notify => Service['sympa'],
- }
-
- if $sender_ldap_group {
- if ! defined(Sympa::Server::Scenario_sender_ldap_group[$sender_ldap_group]) {
- sympa::server::scenario_sender_ldap_group { $sender_ldap_group: }
- }
- }
-
- if $sender_email {
- if ! defined(Sympa::Server::Scenario_sender_email[$sender_email]) {
- sympa::server::scenario_sender_email { $sender_email: }
- }
- }
-
- if $subscriber_ldap_group {
- if ! defined(Sympa::Server::Ldap_search_filter[$subscriber_ldap_group]) {
- sympa::server::ldap_search_filter { $subscriber_ldap_group: }
- }
- }
- }
-
-#
-# various types of list that can be directly used
-#
-#
-
- # public discussion list
- # reply_to is set to the list
- define public_list($subject, $language = 'en', $topics = false) {
- include sympa::variable
- list { $name:
- subject => $subject,
- # profile => "public",
- language => $language,
- topics => $topics,
- reply_to => "$name@$sympa::variable::vhost",
- }
- }
-
- # list where announce are sent by member of ldap_group
- # reply_to is set to $reply_to
- define announce_list_group($subject, $reply_to, $sender_ldap_group, $language = 'en', $topics = false) {
- # profile + scenario
- list{ $name:
- subject => $subject,
- profile => "",
- language => $language,
- topics => $topics,
- reply_to => $reply_to,
- sender_ldap_group => $sender_ldap_group,
- }
- }
-
-
- # list where announce are sent by $email only
- # reply_to is set to $reply_to
- define announce_list_email($subject, $reply_to, $sender_email, $language = 'en', $topics = false) {
- list{ $name:
- subject => $subject,
- profile => "",
- language => $language,
- topics => $topics,
- reply_to => $reply_to,
- sender_email => $sender_email,
- }
- }
-
- # list where people cannot subscribe, where people from $ldap_group receive
- # mail, with public archive
- define restricted_list($subject, $subscriber_ldap_group, $language = 'en', $topics = false) {
- list{ $name:
- subject => $subject,
- profile => "",
- topics => $topics,
- language => $language,
- subscriber_ldap_group => $subscriber_ldap_group,
- sender_ldap_group => $subscriber_ldap_group,
- }
- }
-
- # list where only people from the ldap_group can post, ad where they are subscribe
- # by default, but anybody else can subscribe to read and receive messages
- define public_restricted_list($subject, $subscriber_ldap_group, $language = 'en', $topics = false) {
- list{ $name:
- subject => $subject,
- profile => "",
- topics => $topics,
- language => $language,
- subscriber_ldap_group => $subscriber_ldap_group,
- sender_ldap_group => $subscriber_ldap_group,
- subscription_open => true,
- }
- }
-
-
- # same as restricted list, but anybody can post
- define restricted_list_open($subject, $subscriber_ldap_group, $language = 'en', $topics = false) {
- list{ $name:
- subject => $subject,
- profile => "",
- language => $language,
- topics => $topics,
- subscriber_ldap_group => $subscriber_ldap_group,
- sender_ldap_group => $subscriber_ldap_group,
- }
- }
-
}
-
diff --git a/modules/sympa/manifests/list.pp b/modules/sympa/manifests/list.pp
new file mode 100644
index 00000000..b27e0cff
--- /dev/null
+++ b/modules/sympa/manifests/list.pp
@@ -0,0 +1,62 @@
+define sympa::list( $subject,
+ $profile = false,
+ $language = 'en',
+ $topics = false,
+ $reply_to = false,
+ $sender_email = false,
+ $sender_ldap_group = false,
+ $subscriber_ldap_group = false,
+ $public_archive = true,
+ $subscription_open = false) {
+
+ include sympa::variable
+ $ldap_password = extlookup(i'sympa_ldap','x')
+ $custom_subject = $name
+
+ $xml_file = "/etc/sympa/lists_xml/$name.xml"
+
+ if $sender_email {
+ $sender_email_file = regsubst($sender_email,'\@','-at-')
+ } else {
+ $sender_email_file = ''
+ }
+
+ file { $xml_file:
+ content => template('sympa/list.xml'),
+ require => Package[sympa],
+ }
+
+ exec { "sympa.pl --create_list --robot=$sympa::variable::vhost --input_file=$xml_file":
+ require => File[$xml_file],
+ creates => "/var/lib/sympa/expl/$name",
+ before => File["/var/lib/sympa/expl/$name/config"],
+ }
+
+ file { "/var/lib/sympa/expl/$name/config":
+ owner => 'sympa',
+ group => 'sympa',
+ mode => '0750',
+ content => template('sympa/config'),
+ notify => Service['sympa'],
+ }
+
+ if $sender_ldap_group {
+ if ! defined(Sympa::Server::Scenario_sender_ldap_group[$sender_ldap_group]) {
+ sympa::server::scenario_sender_ldap_group { $sender_ldap_group: }
+ }
+ }
+
+ if $sender_email {
+ if ! defined(Sympa::Server::Scenario_sender_email[$sender_email]) {
+ sympa::server::scenario_sender_email { $sender_email: }
+ }
+ }
+
+ if $subscriber_ldap_group {
+ if ! defined(Sympa::Server::Ldap_search_filter[$subscriber_ldap_group]) {
+ sympa::server::ldap_search_filter { $subscriber_ldap_group: }
+ }
+ }
+}
+
+
diff --git a/modules/sympa/manifests/public_list.pp b/modules/sympa/manifests/public_list.pp
new file mode 100644
index 00000000..6b660abf
--- /dev/null
+++ b/modules/sympa/manifests/public_list.pp
@@ -0,0 +1,13 @@
+# public discussion list
+# reply_to is set to the list
+define sympa::public_list($subject,
+ $language = 'en',
+ $topics = false) {
+ include sympa::variable
+ list { $name:
+ subject => $subject,
+ language => $language,
+ topics => $topics,
+ reply_to => "$name@$sympa::variable::vhost",
+ }
+}
diff --git a/modules/sympa/manifests/public_restricted_list.pp b/modules/sympa/manifests/public_restricted_list.pp
new file mode 100644
index 00000000..fec079f7
--- /dev/null
+++ b/modules/sympa/manifests/public_restricted_list.pp
@@ -0,0 +1,17 @@
+# list where only people from the ldap_group can post, ad where
+# they are subscribed by default, but anybody else can subscribe
+# to read and receive messages
+define sympa::public_restricted_list( $subject,
+ $subscriber_ldap_group,
+ $language = 'en',
+ $topics = false) {
+ list { $name:
+ subject => $subject,
+ profile => '',
+ topics => $topics,
+ language => $language,
+ subscriber_ldap_group => $subscriber_ldap_group,
+ sender_ldap_group => $subscriber_ldap_group,
+ subscription_open => true,
+ }
+}
diff --git a/modules/sympa/manifests/restricted_list.pp b/modules/sympa/manifests/restricted_list.pp
new file mode 100644
index 00000000..798531de
--- /dev/null
+++ b/modules/sympa/manifests/restricted_list.pp
@@ -0,0 +1,15 @@
+# list where people cannot subscribe, where people from $ldap_group receive
+# mail, with public archive
+define sympa::restricted_list($subject,
+ $subscriber_ldap_group,
+ $language = 'en',
+ $topics = false) {
+ list { $name:
+ subject => $subject,
+ profile => '',
+ topics => $topics,
+ language => $language,
+ subscriber_ldap_group => $subscriber_ldap_group,
+ sender_ldap_group => $subscriber_ldap_group,
+ }
+}
diff --git a/modules/sympa/manifests/restricted_list_open.pp b/modules/sympa/manifests/restricted_list_open.pp
new file mode 100644
index 00000000..1730b970
--- /dev/null
+++ b/modules/sympa/manifests/restricted_list_open.pp
@@ -0,0 +1,14 @@
+# same as restricted list, but anybody can post
+define sympa::restricted_list_open( $subject,
+ $subscriber_ldap_group,
+ $language = 'en',
+ $topics = false) {
+ list { $name:
+ subject => $subject,
+ profile => '',
+ language => $language,
+ topics => $topics,
+ subscriber_ldap_group => $subscriber_ldap_group,
+ sender_ldap_group => $subscriber_ldap_group,
+ }
+}