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

  ViewVC Help
Powered by ViewVC 1.1.30