/[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 578 - (hide annotations) (download)
Mon Dec 13 23:54:56 2010 UTC (13 years, 3 months ago) by misc
File size: 4203 byte(s)
create directory to hold scenari
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 576 define ldap_search_filter {
89     file { "/etc/sympa/search_filters/ldap-$name.ldap":
90     ensure => present,
91     owner => root,
92     group => root,
93     mode => 755,
94     content => template('sympa/group.ldap')
95     }
96     }
97    
98 misc 574 define ldap_group_datasource {
99     file { "/etc/sympa/data_sources/ldap-$name.incl":
100     ensure => present,
101     owner => root,
102     group => root,
103     mode => 755,
104     content => template('sympa/ldap_group.incl')
105     }
106     }
107     # add each group that could be used in a sympa ml either as
108     # - owner
109     # - editor ( moderation )
110     ldap_group_datasource { "mga-sysadm": }
111     ldap_group_datasource { "mga-ml_moderators": }
112    
113 misc 576 ldap_search_filter { "mga-board": }
114    
115 misc 569 # directory that will hold the list data
116     # i am not sure of the name ( misc, 09/12/10 )
117     file { "/var/lib/sympa/expl/":
118     ensure => directory,
119     owner => sympa,
120     group => root,
121     mode => 755,
122     }
123 dmorgan 234 }
124 misc 557
125     define list($subject, $profile, $language = 'en') {
126    
127 misc 562 include sympa::variable
128    
129 misc 557 $xml_file = "/etc/sympa/lists_xml/$name.xml"
130    
131     file { "$xml_file":
132     owner => root,
133     group => root,
134     content => template('sympa/list.xml')
135     }
136    
137 misc 562 exec { "sympa.pl --create_list --robot=$sympa::variable::vhost --input_file=$xml_file":
138 misc 557 refreshonly => true,
139     subscribe => File["$xml_file"]
140     }
141     }
142 dmorgan 234 }
143    

  ViewVC Help
Powered by ViewVC 1.1.30