/[adm]/puppet/modules/sympa/manifests/init.pp
ViewVC logotype

Annotation of /puppet/modules/sympa/manifests/init.pp

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.30