/[adm]/puppet/modules/sympa/manifests/init.pp
ViewVC logotype

Contents of /puppet/modules/sympa/manifests/init.pp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 574 - (show annotations) (download)
Fri Dec 10 20:17:40 2010 UTC (13 years, 4 months ago) by misc
File size: 3748 byte(s)
- add 2 datasources for owner and moderation, to have the defined in
  ldap
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_list = ['sympa', 'sympa-www', 'perl-CGI-Fast',
11 'perl-Socket6']
12
13 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 subscribe => [ Package["sympa"], File['/etc/sympa/sympa.conf']]
23 }
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 notify => Service['httpd']
49 }
50
51
52 include apache::mod_fcgid
53 apache::webapp_other{"sympa":
54 webapp_file => "sympa/webapp_sympa.conf",
55 }
56
57 apache::vhost_redirect_ssl { "$vhost": }
58
59 apache::vhost_other_app { "$vhost":
60 vhost_file => "sympa/vhost_ml.conf",
61 }
62
63 openssl::self_signed_cert{ "$vhost":
64 directory => "/etc/ssl/apache/"
65 }
66
67
68 @@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
78 file { ["/etc/sympa/lists_xml/","/etc/sympa/data_sources/"]:
79 ensure => directory,
80 owner => root,
81 group => root,
82 mode => 755,
83 }
84
85 define ldap_group_datasource {
86 file { "/etc/sympa/data_sources/ldap-$name.incl":
87 ensure => present,
88 owner => root,
89 group => root,
90 mode => 755,
91 content => template('sympa/ldap_group.incl')
92 }
93 }
94 # add each group that could be used in a sympa ml either as
95 # - owner
96 # - editor ( moderation )
97 ldap_group_datasource { "mga-sysadm": }
98 ldap_group_datasource { "mga-ml_moderators": }
99
100 # directory that will hold the list data
101 # i am not sure of the name ( misc, 09/12/10 )
102 file { "/var/lib/sympa/expl/":
103 ensure => directory,
104 owner => sympa,
105 group => root,
106 mode => 755,
107 }
108 }
109
110 define list($subject, $profile, $language = 'en') {
111
112 include sympa::variable
113
114 $xml_file = "/etc/sympa/lists_xml/$name.xml"
115
116 file { "$xml_file":
117 owner => root,
118 group => root,
119 content => template('sympa/list.xml')
120 }
121
122 exec { "sympa.pl --create_list --robot=$sympa::variable::vhost --input_file=$xml_file":
123 refreshonly => true,
124 subscribe => File["$xml_file"]
125 }
126 }
127 }
128

  ViewVC Help
Powered by ViewVC 1.1.30