1 |
class sympa { |
2 |
class variable { |
3 |
$vhost = "ml.$domain" |
4 |
} |
5 |
|
6 |
class server inherits variable { |
7 |
# perl-CGI-Fast is needed for fast cgi |
8 |
# perl-Socket6 is required by perl-IO-Socket-SSL |
9 |
# (optional requirement) |
10 |
package { ['sympa', 'sympa-www', 'perl-CGI-Fast', |
11 |
'perl-Socket6']: } |
12 |
|
13 |
# sympa script start 5 differents script, I am not |
14 |
# sure that puppet will correctly handle this |
15 |
service { "sympa": |
16 |
subscribe => [ Package["sympa"], File['/etc/sympa/sympa.conf']] |
17 |
} |
18 |
|
19 |
$pgsql_password = extlookup("sympa_pgsql",'x') |
20 |
$ldap_password = extlookup("sympa_ldap",'x') |
21 |
|
22 |
postgresql::remote_db_and_user { 'sympa': |
23 |
password => $pgsql_password, |
24 |
description => "Sympa database", |
25 |
} |
26 |
|
27 |
File { |
28 |
require => Package['sympa'], |
29 |
} |
30 |
|
31 |
file { '/etc/sympa/sympa.conf': |
32 |
# should be cleaner to have it root owned, but puppet do not support acl |
33 |
# and in any case, config will be reset if it change |
34 |
owner => sympa, |
35 |
group => apache, |
36 |
mode => 640, |
37 |
content => template("sympa/sympa.conf"), |
38 |
} |
39 |
|
40 |
file { '/etc/sympa/auth.conf': |
41 |
content => template("sympa/auth.conf"), |
42 |
notify => Service['httpd'], |
43 |
} |
44 |
|
45 |
|
46 |
include apache::mod_fcgid |
47 |
apache::webapp_other{"sympa": |
48 |
webapp_file => "sympa/webapp_sympa.conf", |
49 |
} |
50 |
|
51 |
apache::vhost_redirect_ssl { "$vhost": } |
52 |
|
53 |
apache::vhost_base { "$vhost": |
54 |
use_ssl => true, |
55 |
content => template("sympa/vhost_ml.conf"), |
56 |
} |
57 |
|
58 |
subversion::snapshot { "/etc/sympa/web_tt2": |
59 |
source => "svn://svn.mageia.org/svn/web/templates/sympa/trunk" |
60 |
} |
61 |
|
62 |
file { ["/etc/sympa/lists_xml/", |
63 |
"/etc/sympa/scenari/", |
64 |
"/etc/sympa/data_sources/", |
65 |
"/etc/sympa/search_filters/"]: |
66 |
ensure => directory, |
67 |
purge => true, |
68 |
recurse => true, |
69 |
force => true, |
70 |
} |
71 |
|
72 |
file { |
73 |
"/etc/sympa/scenari/subscribe.open_web_only_notify": |
74 |
source => "puppet:///modules/sympa/scenari/open_web_only_notify"; |
75 |
"/etc/sympa/scenari/unsubscribe.open_web_only_notify": |
76 |
source => "puppet:///modules/sympa/scenari/open_web_only_notify"; |
77 |
"/etc/sympa/scenari/send.subscriber_moderated": |
78 |
source => "puppet:///modules/sympa/scenari/subscriber_moderated"; |
79 |
"/etc/sympa/scenari/create_list.forbidden": |
80 |
source => "puppet:///modules/sympa/scenari/forbidden"; |
81 |
"/etc/sympa/topics.conf": |
82 |
source => "puppet:///modules/sympa/topics.conf"; |
83 |
} |
84 |
|
85 |
define ldap_search_filter { |
86 |
file { "/etc/sympa/search_filters/$name.ldap": |
87 |
content => template('sympa/search_filters/group.ldap') |
88 |
} |
89 |
} |
90 |
|
91 |
define ldap_group_datasource { |
92 |
file { "/etc/sympa/data_sources/$name.incl": |
93 |
content => template('sympa/data_sources/ldap_group.incl') |
94 |
} |
95 |
} |
96 |
|
97 |
# add each group that could be used in a sympa ml either as |
98 |
# - owner |
99 |
# - editor ( moderation ) |
100 |
ldap_group_datasource { "mga-sysadmin": } |
101 |
ldap_group_datasource { "mga-ml_moderators": } |
102 |
|
103 |
|
104 |
# directory that will hold the list data |
105 |
# i am not sure of the name ( misc, 09/12/10 ) |
106 |
file { "/var/lib/sympa/expl/": |
107 |
ensure => directory, |
108 |
owner => sympa, |
109 |
} |
110 |
} |
111 |
} |