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 |
|
|
content => template("sympa/auth.conf") |
48 |
|
|
} |
49 |
|
|
|
50 |
|
|
|
51 |
|
|
include apache::mod_fcgid |
52 |
|
|
apache::webapp_other{"sympa": |
53 |
misc |
560 |
webapp_file => "sympa/webapp_sympa.conf", |
54 |
misc |
551 |
} |
55 |
misc |
560 |
|
56 |
misc |
562 |
apache::vhost_redirect_ssl { "$vhost": } |
57 |
misc |
560 |
|
58 |
misc |
562 |
apache::vhost_other_app { "$vhost": |
59 |
misc |
551 |
vhost_file => "sympa/vhost_ml.conf", |
60 |
|
|
} |
61 |
misc |
560 |
|
62 |
misc |
562 |
openssl::self_signed_cert{ "$vhost": |
63 |
misc |
560 |
directory => "/etc/ssl/apache/" |
64 |
|
|
} |
65 |
misc |
551 |
|
66 |
misc |
560 |
|
67 |
misc |
551 |
@@postgresql::database { 'sympa': |
68 |
|
|
description => "Sympa database", |
69 |
|
|
user => "sympa", |
70 |
|
|
require => Postgresql::User["sympa"] |
71 |
|
|
} |
72 |
|
|
|
73 |
|
|
subversion::snapshot { "/etc/sympa/web_tt2": |
74 |
|
|
source => "svn://svn.mageia.org/svn/web/templates/sympa/trunk" |
75 |
|
|
} |
76 |
misc |
553 |
|
77 |
|
|
file { "/etc/sympa/lists_xml/": |
78 |
|
|
ensure => directory, |
79 |
|
|
owner => root, |
80 |
|
|
group => root, |
81 |
|
|
mode => 755, |
82 |
|
|
} |
83 |
misc |
569 |
|
84 |
|
|
# directory that will hold the list data |
85 |
|
|
# i am not sure of the name ( misc, 09/12/10 ) |
86 |
|
|
file { "/var/lib/sympa/expl/": |
87 |
|
|
ensure => directory, |
88 |
|
|
owner => sympa, |
89 |
|
|
group => root, |
90 |
|
|
mode => 755, |
91 |
|
|
} |
92 |
dmorgan |
234 |
} |
93 |
misc |
557 |
|
94 |
|
|
define list($subject, $profile, $language = 'en') { |
95 |
|
|
|
96 |
misc |
562 |
include sympa::variable |
97 |
|
|
|
98 |
misc |
557 |
$xml_file = "/etc/sympa/lists_xml/$name.xml" |
99 |
|
|
|
100 |
|
|
file { "$xml_file": |
101 |
|
|
owner => root, |
102 |
|
|
group => root, |
103 |
|
|
content => template('sympa/list.xml') |
104 |
|
|
} |
105 |
|
|
|
106 |
misc |
562 |
exec { "sympa.pl --create_list --robot=$sympa::variable::vhost --input_file=$xml_file": |
107 |
misc |
557 |
refreshonly => true, |
108 |
|
|
subscribe => File["$xml_file"] |
109 |
|
|
} |
110 |
|
|
} |
111 |
dmorgan |
234 |
} |
112 |
|
|
|