/[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 588 - (hide annotations) (download)
Mon Dec 13 23:55:08 2010 UTC (13 years, 4 months ago) by misc
File size: 9118 byte(s)
create the scenari for subscription ( web only )
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     $password = extlookup("sympa_password",'x')
26     $ldap_passwd = extlookup("sympa_ldap",'x')
27    
28     @@postgresql::user { 'sympa':
29     password => $password,
30     }
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     }
87 misc 569
88 misc 588 file { ["/etc/sympa/scenari/subscribe.open_web_only_notify",
89     "/etc/sympa/scenari/unsubscribe.open_web_only_notify"]:
90     ensure => present,
91     owner => root,
92     group => root,
93     mode => 755,
94     source => "puppet:///modules/sympa/scenari/open_web_only_notify",
95     }
96    
97 misc 576 define ldap_search_filter {
98     file { "/etc/sympa/search_filters/ldap-$name.ldap":
99     ensure => present,
100     owner => root,
101     group => root,
102     mode => 755,
103 misc 587 content => template('sympa/search_filters/group.ldap')
104 misc 576 }
105     }
106    
107 misc 574 define ldap_group_datasource {
108     file { "/etc/sympa/data_sources/ldap-$name.incl":
109     ensure => present,
110     owner => root,
111     group => root,
112     mode => 755,
113 misc 587 content => template('sympa/data_sources/ldap_group.incl')
114 misc 574 }
115     }
116 misc 581
117     define scenario_sender_ldap_group {
118     # TODO
119    
120     }
121    
122     define scenario_sender_email {
123     # TODO
124     }
125    
126 misc 574 # add each group that could be used in a sympa ml either as
127     # - owner
128     # - editor ( moderation )
129     ldap_group_datasource { "mga-sysadm": }
130     ldap_group_datasource { "mga-ml_moderators": }
131    
132 misc 576
133 misc 569 # directory that will hold the list data
134     # i am not sure of the name ( misc, 09/12/10 )
135     file { "/var/lib/sympa/expl/":
136     ensure => directory,
137     owner => sympa,
138     group => root,
139     mode => 755,
140     }
141 dmorgan 234 }
142 misc 557
143 misc 580 define list($subject,
144     $profile = false,
145     $language = 'en',
146     $reply_to = false,
147     $sender_email = false,
148     $sender_ldap_group = false,
149     $subscriber_ldap_group = false,
150     $public_archive = true ) {
151 misc 557
152 misc 562 include sympa::variable
153    
154 misc 557 $xml_file = "/etc/sympa/lists_xml/$name.xml"
155    
156     file { "$xml_file":
157     owner => root,
158     group => root,
159     content => template('sympa/list.xml')
160     }
161    
162 misc 562 exec { "sympa.pl --create_list --robot=$sympa::variable::vhost --input_file=$xml_file":
163 misc 557 refreshonly => true,
164 misc 580 subscribe => File["$xml_file"],
165     before => File["/var/lib/sympa/expl/$name/config"],
166 misc 557 }
167 misc 580
168     file { "/var/lib/sympa/expl/$name/config":
169     ensure => present,
170     owner => sympa,
171     group => sympa,
172     mode => 750,
173     content => template("sympa/config"),
174     }
175 misc 581
176     if $sender_ldap_group {
177     if ! defined(Sympa::Server::Scenario_sender_ldap_group[$sender_ldap_group]) {
178     sympa::server::scenario_sender_ldap_group { $sender_ldap_group: }
179     }
180     }
181    
182     if $sender_email {
183     if ! defined(Sympa::Server::Scenario_sender_email[$sender_email]) {
184     sympa::server::scenario_sender_email { $sender_email: }
185     }
186     }
187    
188     if $subscriber_ldap_group {
189     if ! defined(Sympa::Server::Ldap_search_filter[$subscriber_ldap_group]) {
190     sympa::server::ldap_search_filter { $subscriber_ldap_group: }
191     }
192     }
193 misc 557 }
194 misc 582
195     #
196     # various types of list that can be directly used
197     #
198     #
199     define public_list($subject, $language = 'en') {
200     list { $name:
201     subject => $subject,
202     # profile => "public",
203     language => $language,
204     }
205     }
206    
207     # list where announce are sent by member of ldap_group
208     # reply_to is set to $reply_to
209     define announce_list_group($subject, $reply_to, $sender_ldap_group, $language = 'en') {
210     # profile + scenario
211     list{ $name:
212     subject => $subject,
213     profile => "",
214     language => $language,
215     reply_to => $reply_to,
216     sender_ldap_group => $sender_ldap_group,
217     }
218     }
219    
220    
221     # list where announce are sent by $email only
222     # reply_to is set to $reply_to
223     define announce_list_email($subject, $reply_to, $sender_email, $language = 'en') {
224     list{ $name:
225     subject => $subject,
226     profile => "",
227     language => $language,
228     reply_to => $reply_to,
229     sender_email => $sender_email,
230     }
231     }
232    
233     # list where people cannot subscribe, where people from $ldap_group receive
234     # mail, with public archive
235     define restricted_list($subject, $subscriber_ldap_group, $language = 'en') {
236     list{ $name:
237     subject => $subject,
238     profile => "",
239     language => $language,
240     subscriber_ldap_group => $subscriber_ldap_group,
241     sender_ldap_group => $subscriber_ldap_group,
242     }
243     }
244    
245     # same as restricted list, but anybody can post
246     define restricted_list_open($subject, $subscriber_ldap_group, $language = 'en') {
247     list{ $name:
248     subject => $subject,
249     profile => "",
250     language => $language,
251     subscriber_ldap_group => $subscriber_ldap_group,
252     sender_ldap_group => $subscriber_ldap_group,
253     }
254     }
255    
256     # list with private archive, restricted to member of $ldap_group
257     define private_list($subject, $subscriber_ldap_group, $language ='en') {
258     list{ $name:
259     subject => $subject,
260     profile => "",
261     language => $language,
262     subscriber_ldap_group => $subscriber_ldap_group,
263     sender_ldap_group => $subscriber_ldap_group,
264     public_archive => false,
265     }
266     }
267    
268     # list with private archive, restricted to member of $ldap_group
269     # everybody can post
270     # used for contact alias
271     define private_list_open($subject, $subscriber_ldap_group, $language ='en') {
272     list{ $name:
273     subject => $subject,
274     profile => "",
275     language => $language,
276     subscriber_ldap_group => $subscriber_ldap_group,
277     public_archive => false,
278     }
279     }
280    
281     # same as private_list, but post are restricted to $email
282     # ( scripting )
283     define private_list_email($subject, $subscriber_ldap_group, $sender_email, $language ='en') {
284     list{ $name:
285     subject => $subject,
286     profile => "",
287     language => $language,
288     subscriber_ldap_group => $subscriber_ldap_group,
289     sender_email => $sender_email,
290     public_archive => false,
291     }
292     }
293 dmorgan 234 }
294    

  ViewVC Help
Powered by ViewVC 1.1.30