1 |
dmorgan |
234 |
class sympa { |
2 |
misc |
562 |
class variable { |
3 |
|
|
$vhost = "ml.$domain" |
4 |
|
|
} |
5 |
|
|
|
6 |
|
|
class server inherits variable { |
7 |
misc |
551 |
# perl-CGI-Fast is needed for fast cgi |
8 |
|
|
# perl-Socket6 is required by perl-IO-Socket-SSL |
9 |
|
|
# (optional requirement) |
10 |
misc |
2295 |
package { ['sympa', 'sympa-www', 'perl-CGI-Fast', |
11 |
|
|
'perl-Socket6']: } |
12 |
|
|
|
13 |
misc |
551 |
# sympa script start 5 differents script, I am not |
14 |
|
|
# sure that puppet will correctly handle this |
15 |
|
|
service { "sympa": |
16 |
misc |
566 |
subscribe => [ Package["sympa"], File['/etc/sympa/sympa.conf']] |
17 |
misc |
551 |
} |
18 |
|
|
|
19 |
misc |
624 |
$pgsql_password = extlookup("sympa_pgsql",'x') |
20 |
misc |
1397 |
$ldap_password = extlookup("sympa_ldap",'x') |
21 |
misc |
551 |
|
22 |
misc |
1356 |
postgresql::remote_db_and_user { 'sympa': |
23 |
misc |
624 |
password => $pgsql_password, |
24 |
misc |
1356 |
description => "Sympa database", |
25 |
misc |
551 |
} |
26 |
misc |
2296 |
|
27 |
|
|
File { |
28 |
|
|
require => Package['sympa'], |
29 |
|
|
} |
30 |
|
|
|
31 |
misc |
551 |
file { '/etc/sympa/sympa.conf': |
32 |
|
|
# should be cleaner to have it root owned, but puppet do not support acl |
33 |
|
|
# and in any case, config will be reset if it change |
34 |
|
|
owner => sympa, |
35 |
|
|
group => apache, |
36 |
|
|
mode => 640, |
37 |
misc |
1967 |
content => template("sympa/sympa.conf"), |
38 |
misc |
551 |
} |
39 |
|
|
|
40 |
|
|
file { '/etc/sympa/auth.conf': |
41 |
misc |
571 |
content => template("sympa/auth.conf"), |
42 |
misc |
1967 |
notify => Service['httpd'], |
43 |
misc |
551 |
} |
44 |
|
|
|
45 |
|
|
|
46 |
|
|
include apache::mod_fcgid |
47 |
|
|
apache::webapp_other{"sympa": |
48 |
misc |
560 |
webapp_file => "sympa/webapp_sympa.conf", |
49 |
misc |
551 |
} |
50 |
misc |
560 |
|
51 |
misc |
562 |
apache::vhost_redirect_ssl { "$vhost": } |
52 |
misc |
560 |
|
53 |
boklm |
1235 |
apache::vhost_base { "$vhost": |
54 |
misc |
2295 |
use_ssl => true, |
55 |
boklm |
1235 |
content => template("sympa/vhost_ml.conf"), |
56 |
misc |
551 |
} |
57 |
misc |
1356 |
|
58 |
misc |
551 |
subversion::snapshot { "/etc/sympa/web_tt2": |
59 |
|
|
source => "svn://svn.mageia.org/svn/web/templates/sympa/trunk" |
60 |
|
|
} |
61 |
misc |
553 |
|
62 |
misc |
576 |
file { ["/etc/sympa/lists_xml/", |
63 |
misc |
578 |
"/etc/sympa/scenari/", |
64 |
misc |
576 |
"/etc/sympa/data_sources/", |
65 |
|
|
"/etc/sympa/search_filters/"]: |
66 |
misc |
553 |
ensure => directory, |
67 |
misc |
635 |
purge => true, |
68 |
|
|
recurse => true, |
69 |
|
|
force => true, |
70 |
misc |
553 |
} |
71 |
misc |
569 |
|
72 |
misc |
588 |
file { ["/etc/sympa/scenari/subscribe.open_web_only_notify", |
73 |
|
|
"/etc/sympa/scenari/unsubscribe.open_web_only_notify"]: |
74 |
|
|
mode => 755, |
75 |
|
|
source => "puppet:///modules/sympa/scenari/open_web_only_notify", |
76 |
|
|
} |
77 |
|
|
|
78 |
misc |
611 |
file { ["/etc/sympa/scenari/send.subscriber_moderated"]: |
79 |
|
|
mode => 755, |
80 |
|
|
source => "puppet:///modules/sympa/scenari/subscriber_moderated", |
81 |
|
|
} |
82 |
|
|
|
83 |
misc |
690 |
file { ["/etc/sympa/scenari/create_list.forbidden"]: |
84 |
|
|
mode => 755, |
85 |
|
|
source => "puppet:///modules/sympa/scenari/forbidden", |
86 |
|
|
} |
87 |
|
|
|
88 |
|
|
|
89 |
misc |
643 |
file { ["/etc/sympa/topics.conf"]: |
90 |
|
|
mode => 755, |
91 |
|
|
source => "puppet:///modules/sympa/topics.conf", |
92 |
|
|
} |
93 |
|
|
|
94 |
misc |
576 |
define ldap_search_filter { |
95 |
misc |
604 |
file { "/etc/sympa/search_filters/$name.ldap": |
96 |
misc |
576 |
mode => 755, |
97 |
misc |
587 |
content => template('sympa/search_filters/group.ldap') |
98 |
misc |
576 |
} |
99 |
|
|
} |
100 |
|
|
|
101 |
misc |
574 |
define ldap_group_datasource { |
102 |
misc |
598 |
file { "/etc/sympa/data_sources/$name.incl": |
103 |
misc |
574 |
mode => 755, |
104 |
misc |
587 |
content => template('sympa/data_sources/ldap_group.incl') |
105 |
misc |
574 |
} |
106 |
|
|
} |
107 |
misc |
581 |
|
108 |
|
|
define scenario_sender_ldap_group { |
109 |
misc |
606 |
file { "/etc/sympa/scenari/send.restricted_$name": |
110 |
misc |
589 |
mode => 755, |
111 |
|
|
content => template('sympa/scenari/sender.ldap_group') |
112 |
|
|
} |
113 |
misc |
581 |
} |
114 |
|
|
|
115 |
|
|
define scenario_sender_email { |
116 |
misc |
758 |
$sender_email_file = regsubst($name,'\@','-at-') |
117 |
|
|
file { "/etc/sympa/scenari/send.restricted_$sender_email_file": |
118 |
misc |
589 |
mode => 755, |
119 |
|
|
content => template('sympa/scenari/sender.email') |
120 |
|
|
} |
121 |
misc |
581 |
} |
122 |
|
|
|
123 |
misc |
574 |
# add each group that could be used in a sympa ml either as |
124 |
|
|
# - owner |
125 |
|
|
# - editor ( moderation ) |
126 |
misc |
602 |
ldap_group_datasource { "mga-sysadmin": } |
127 |
misc |
574 |
ldap_group_datasource { "mga-ml_moderators": } |
128 |
|
|
|
129 |
misc |
576 |
|
130 |
misc |
569 |
# directory that will hold the list data |
131 |
|
|
# i am not sure of the name ( misc, 09/12/10 ) |
132 |
|
|
file { "/var/lib/sympa/expl/": |
133 |
|
|
ensure => directory, |
134 |
|
|
owner => sympa, |
135 |
|
|
} |
136 |
dmorgan |
234 |
} |
137 |
misc |
557 |
|
138 |
misc |
580 |
define list($subject, |
139 |
|
|
$profile = false, |
140 |
|
|
$language = 'en', |
141 |
misc |
644 |
$topics = false, |
142 |
misc |
580 |
$reply_to = false, |
143 |
|
|
$sender_email = false, |
144 |
|
|
$sender_ldap_group = false, |
145 |
|
|
$subscriber_ldap_group = false, |
146 |
misc |
1344 |
$public_archive = true, |
147 |
misc |
2004 |
$subscription_open = false) { |
148 |
misc |
557 |
|
149 |
misc |
562 |
include sympa::variable |
150 |
misc |
1396 |
$ldap_password = extlookup("sympa_ldap",'x') |
151 |
boklm |
2019 |
$custom_subject = $name |
152 |
misc |
562 |
|
153 |
misc |
557 |
$xml_file = "/etc/sympa/lists_xml/$name.xml" |
154 |
|
|
|
155 |
misc |
607 |
if $sender_email { |
156 |
|
|
$sender_email_file = regsubst($sender_email,'\@','-at-') |
157 |
|
|
} else { |
158 |
|
|
$sender_email_file = '' |
159 |
|
|
} |
160 |
|
|
|
161 |
misc |
557 |
file { "$xml_file": |
162 |
misc |
1971 |
content => template('sympa/list.xml'), |
163 |
misc |
1967 |
require => Package[sympa], |
164 |
misc |
557 |
} |
165 |
|
|
|
166 |
misc |
562 |
exec { "sympa.pl --create_list --robot=$sympa::variable::vhost --input_file=$xml_file": |
167 |
misc |
590 |
require => File["$xml_file"], |
168 |
misc |
592 |
creates => "/var/lib/sympa/expl/$name", |
169 |
misc |
580 |
before => File["/var/lib/sympa/expl/$name/config"], |
170 |
misc |
557 |
} |
171 |
misc |
580 |
|
172 |
|
|
file { "/var/lib/sympa/expl/$name/config": |
173 |
|
|
owner => sympa, |
174 |
|
|
group => sympa, |
175 |
|
|
mode => 750, |
176 |
|
|
content => template("sympa/config"), |
177 |
misc |
645 |
notify => Service['sympa'], |
178 |
misc |
580 |
} |
179 |
misc |
581 |
|
180 |
|
|
if $sender_ldap_group { |
181 |
|
|
if ! defined(Sympa::Server::Scenario_sender_ldap_group[$sender_ldap_group]) { |
182 |
|
|
sympa::server::scenario_sender_ldap_group { $sender_ldap_group: } |
183 |
|
|
} |
184 |
|
|
} |
185 |
|
|
|
186 |
|
|
if $sender_email { |
187 |
misc |
758 |
if ! defined(Sympa::Server::Scenario_sender_email[$sender_email]) { |
188 |
|
|
sympa::server::scenario_sender_email { $sender_email: } |
189 |
misc |
581 |
} |
190 |
|
|
} |
191 |
|
|
|
192 |
|
|
if $subscriber_ldap_group { |
193 |
|
|
if ! defined(Sympa::Server::Ldap_search_filter[$subscriber_ldap_group]) { |
194 |
|
|
sympa::server::ldap_search_filter { $subscriber_ldap_group: } |
195 |
|
|
} |
196 |
|
|
} |
197 |
misc |
557 |
} |
198 |
misc |
582 |
|
199 |
|
|
# |
200 |
|
|
# various types of list that can be directly used |
201 |
|
|
# |
202 |
|
|
# |
203 |
boklm |
2087 |
|
204 |
|
|
# public discussion list |
205 |
|
|
# reply_to is set to the list |
206 |
misc |
644 |
define public_list($subject, $language = 'en', $topics = false) { |
207 |
boklm |
2088 |
include sympa::variable |
208 |
misc |
582 |
list { $name: |
209 |
|
|
subject => $subject, |
210 |
|
|
# profile => "public", |
211 |
|
|
language => $language, |
212 |
misc |
675 |
topics => $topics, |
213 |
boklm |
2087 |
reply_to => "$name@$sympa::variable::vhost", |
214 |
misc |
582 |
} |
215 |
|
|
} |
216 |
|
|
|
217 |
|
|
# list where announce are sent by member of ldap_group |
218 |
|
|
# reply_to is set to $reply_to |
219 |
misc |
644 |
define announce_list_group($subject, $reply_to, $sender_ldap_group, $language = 'en', $topics = false) { |
220 |
misc |
582 |
# profile + scenario |
221 |
|
|
list{ $name: |
222 |
|
|
subject => $subject, |
223 |
|
|
profile => "", |
224 |
|
|
language => $language, |
225 |
misc |
675 |
topics => $topics, |
226 |
misc |
582 |
reply_to => $reply_to, |
227 |
|
|
sender_ldap_group => $sender_ldap_group, |
228 |
|
|
} |
229 |
|
|
} |
230 |
|
|
|
231 |
|
|
|
232 |
|
|
# list where announce are sent by $email only |
233 |
|
|
# reply_to is set to $reply_to |
234 |
misc |
644 |
define announce_list_email($subject, $reply_to, $sender_email, $language = 'en', $topics = false) { |
235 |
misc |
582 |
list{ $name: |
236 |
|
|
subject => $subject, |
237 |
|
|
profile => "", |
238 |
|
|
language => $language, |
239 |
misc |
675 |
topics => $topics, |
240 |
misc |
582 |
reply_to => $reply_to, |
241 |
|
|
sender_email => $sender_email, |
242 |
|
|
} |
243 |
|
|
} |
244 |
|
|
|
245 |
|
|
# list where people cannot subscribe, where people from $ldap_group receive |
246 |
|
|
# mail, with public archive |
247 |
misc |
644 |
define restricted_list($subject, $subscriber_ldap_group, $language = 'en', $topics = false) { |
248 |
misc |
582 |
list{ $name: |
249 |
|
|
subject => $subject, |
250 |
|
|
profile => "", |
251 |
misc |
675 |
topics => $topics, |
252 |
misc |
582 |
language => $language, |
253 |
|
|
subscriber_ldap_group => $subscriber_ldap_group, |
254 |
|
|
sender_ldap_group => $subscriber_ldap_group, |
255 |
|
|
} |
256 |
|
|
} |
257 |
|
|
|
258 |
misc |
1345 |
# list where only people from the ldap_group can post, ad where they are subscribe |
259 |
|
|
# by default, but anybody else can subscribe to read and receive messages |
260 |
|
|
define public_restricted_list($subject, $subscriber_ldap_group, $language = 'en', $topics = false) { |
261 |
|
|
list{ $name: |
262 |
|
|
subject => $subject, |
263 |
|
|
profile => "", |
264 |
|
|
topics => $topics, |
265 |
|
|
language => $language, |
266 |
|
|
subscriber_ldap_group => $subscriber_ldap_group, |
267 |
|
|
sender_ldap_group => $subscriber_ldap_group, |
268 |
|
|
subscription_open => true, |
269 |
|
|
} |
270 |
|
|
} |
271 |
|
|
|
272 |
|
|
|
273 |
misc |
582 |
# same as restricted list, but anybody can post |
274 |
misc |
644 |
define restricted_list_open($subject, $subscriber_ldap_group, $language = 'en', $topics = false) { |
275 |
misc |
582 |
list{ $name: |
276 |
|
|
subject => $subject, |
277 |
|
|
profile => "", |
278 |
|
|
language => $language, |
279 |
misc |
675 |
topics => $topics, |
280 |
misc |
582 |
subscriber_ldap_group => $subscriber_ldap_group, |
281 |
|
|
sender_ldap_group => $subscriber_ldap_group, |
282 |
|
|
} |
283 |
|
|
} |
284 |
|
|
|
285 |
|
|
# list with private archive, restricted to member of $ldap_group |
286 |
misc |
644 |
define private_list($subject, $subscriber_ldap_group, $language ='en', $topics = false) { |
287 |
misc |
582 |
list{ $name: |
288 |
|
|
subject => $subject, |
289 |
|
|
profile => "", |
290 |
|
|
language => $language, |
291 |
misc |
675 |
topics => $topics, |
292 |
misc |
582 |
subscriber_ldap_group => $subscriber_ldap_group, |
293 |
|
|
sender_ldap_group => $subscriber_ldap_group, |
294 |
|
|
public_archive => false, |
295 |
|
|
} |
296 |
|
|
} |
297 |
|
|
|
298 |
|
|
# list with private archive, restricted to member of $ldap_group |
299 |
|
|
# everybody can post |
300 |
|
|
# used for contact alias |
301 |
misc |
644 |
define private_list_open($subject, $subscriber_ldap_group, $language ='en', $topics = false) { |
302 |
misc |
582 |
list{ $name: |
303 |
|
|
subject => $subject, |
304 |
|
|
profile => "", |
305 |
|
|
language => $language, |
306 |
misc |
675 |
topics => $topics, |
307 |
misc |
582 |
subscriber_ldap_group => $subscriber_ldap_group, |
308 |
|
|
public_archive => false, |
309 |
|
|
} |
310 |
|
|
} |
311 |
|
|
|
312 |
|
|
# same as private_list, but post are restricted to $email |
313 |
|
|
# ( scripting ) |
314 |
misc |
644 |
define private_list_email($subject, $subscriber_ldap_group, $sender_email, $language ='en', $topics = false) { |
315 |
misc |
582 |
list{ $name: |
316 |
|
|
subject => $subject, |
317 |
|
|
profile => "", |
318 |
|
|
language => $language, |
319 |
misc |
675 |
topics => $topics, |
320 |
misc |
582 |
subscriber_ldap_group => $subscriber_ldap_group, |
321 |
|
|
sender_email => $sender_email, |
322 |
|
|
public_archive => false, |
323 |
|
|
} |
324 |
|
|
} |
325 |
dmorgan |
234 |
} |
326 |
|
|
|