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

  ViewVC Help
Powered by ViewVC 1.1.30