1 |
class sympa { |
2 |
class server { |
3 |
# perl-CGI-Fast is needed for fast cgi |
4 |
# perl-Socket6 is required by perl-IO-Socket-SSL |
5 |
# (optional requirement) |
6 |
$package_list = ['sympa', 'sympa-www', 'perl-CGI-Fast', |
7 |
'perl-Socket6'] |
8 |
|
9 |
package { $package_list: |
10 |
ensure => installed; |
11 |
} |
12 |
|
13 |
# sympa script start 5 differents script, I am not |
14 |
# sure that puppet will correctly handle this |
15 |
service { "sympa": |
16 |
ensure => running, |
17 |
hasstatus => true, |
18 |
subscribe => [ Package["sympa"]] |
19 |
} |
20 |
|
21 |
$password = extlookup("sympa_password",'x') |
22 |
$ldap_passwd = extlookup("sympa_ldap",'x') |
23 |
|
24 |
@@postgresql::user { 'sympa': |
25 |
password => $password, |
26 |
} |
27 |
|
28 |
file { '/etc/sympa/sympa.conf': |
29 |
ensure => present, |
30 |
# should be cleaner to have it root owned, but puppet do not support acl |
31 |
# and in any case, config will be reset if it change |
32 |
owner => sympa, |
33 |
group => apache, |
34 |
mode => 640, |
35 |
content => template("sympa/sympa.conf") |
36 |
} |
37 |
|
38 |
file { '/etc/sympa/auth.conf': |
39 |
ensure => present, |
40 |
owner => root, |
41 |
group => root, |
42 |
mode => 644, |
43 |
content => template("sympa/auth.conf") |
44 |
} |
45 |
|
46 |
|
47 |
include apache::mod_fcgid |
48 |
apache::webapp_other{"sympa": |
49 |
webapp_file => "sympa/webapp_sympa.conf", |
50 |
} |
51 |
|
52 |
apache::vhost_other_app { "ml.$domain": |
53 |
vhost_file => "sympa/vhost_ml.conf", |
54 |
} |
55 |
|
56 |
@@postgresql::database { 'sympa': |
57 |
description => "Sympa database", |
58 |
user => "sympa", |
59 |
require => Postgresql::User["sympa"] |
60 |
} |
61 |
|
62 |
subversion::snapshot { "/etc/sympa/web_tt2": |
63 |
source => "svn://svn.mageia.org/svn/web/templates/sympa/trunk" |
64 |
} |
65 |
|
66 |
file { "/etc/sympa/lists_xml/": |
67 |
ensure => directory, |
68 |
owner => root, |
69 |
group => root, |
70 |
mode => 755, |
71 |
} |
72 |
} |
73 |
|
74 |
define list($subject, $profile, $language = 'en') { |
75 |
|
76 |
$xml_file = "/etc/sympa/lists_xml/$name.xml" |
77 |
|
78 |
file { "$xml_file": |
79 |
owner => root, |
80 |
group => root, |
81 |
content => template('sympa/list.xml') |
82 |
} |
83 |
|
84 |
exec { "sympa.pl --create_list --robot=ml.$domain --input_file=$xml_file": |
85 |
refreshonly => true, |
86 |
subscribe => File["$xml_file"] |
87 |
} |
88 |
} |
89 |
} |
90 |
|