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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1170 - (show annotations) (download)
Tue Feb 22 01:14:40 2011 UTC (13 years, 1 month ago) by misc
File size: 4399 byte(s)
- offer a ssl version of the forum, for login

1 class phpbb {
2 class base {
3 $db = "phpbb"
4 $user = "phpbb"
5
6 include apache::mod_php
7 include mysql
8
9 package { ["php-gd","php-xml","php-zlib","php-ftp","php-magickwand","php-pgsql" ] :
10 ensure => installed
11 }
12
13 package { "perl-DBD-Pg":
14 ensure => installed
15 }
16
17 file { "/usr/local/bin/phpbb_apply_config.pl":
18 ensure => present,
19 owner => root,
20 group => root,
21 mode => 755,
22 source => 'puppet:///modules/phpbb/phpbb_apply_config.pl',
23 }
24
25 $pgsql_password = extlookup("phpbb_pgsql",'x')
26 @@postgresql::user { $user:
27 password => $pgsql_password,
28 }
29
30 $forums_dir = "/var/www/forums/"
31 file { "$forums_dir":
32 ensure => directory,
33 owner => root,
34 group => root,
35 }
36 # TODO add a ssl counterpart
37 # TODO check that everything is locked down
38 apache::vhost_base { "forums.$domain":
39 content => template("phpbb/forums_vhost.conf"),
40 }
41
42 apache::vhost_base { "ssl_forums.$domain":
43 use_ssl => true,
44 vhost => "forums.$domain",
45 content => template("phpbb/forums_vhost.conf"),
46 }
47
48 }
49
50 define phpbb_config($value) {
51 exec { "/usr/local/bin/phpbb_apply_config.pl $name":
52 user => root,
53 environment => ["PGDATABASE=$phpbb::base::database",
54 "PGUSER=$phpbb::base::user",
55 "PGPASSWORD=$phpbb::base::pgsql_password",
56 "PGHOST=pgsql.$domain",
57 "VALUE=$value"],
58 require => File["/usr/local/bin/phpbb_apply_config.pl"],
59 }
60 }
61
62 # TODO find a way to avoid all the phpbb::base prefix
63 define instance() {
64 include phpbb::base
65
66 $lang = $name
67 $database = "${phpbb::base::db}_$lang"
68
69 $user = $phpbb::base::user
70 $pgsql_password = $phpbb::base::pgsql_password
71 $forums_dir = $phpbb::base::forums_dir
72
73 include git::client
74 exec { "git_clone $lang":
75 command =>"git clone git://git.$domain/forum/ $lang",
76 cwd => $forums_dir,
77 creates => "$forums_dir/$lang",
78 require => File["$forums_dir"],
79 notify => "rm_install $lang",
80 }
81
82 # remove this or the forum will not work ( 'board disabled' )
83 # maybe it would be better to move this elsehwere, I
84 # am not sure ( and in any case, that's still in git )
85 exec { "rm_install $lang":
86 command => "rm -Rf $forums_dir/$lang/phpBB/install":
87 onlyif => "test -d $forums_dir/$lang/phpBB/install",
88 }
89
90 # TODO manage the permission of the various subdirectories
91 $writable_dir = ['cache']
92 file { "$forums_dir/$lang/phpBB/$writable_dir":
93 ensure => directory,
94 owner => apache,
95 group => root,
96 mode => 755,
97 require => Exec["git_clone $lang"],
98 }
99
100 file { "$forums_dir/$lang/phpBB/config.php":
101 ensure => present,
102 owner => root,
103 group => root,
104 mode => 644,
105 content => template("phpbb/config.php"),
106 }
107
108
109 @@postgresql::database { $database:
110 description => "Phpbb database",
111 user => $user,
112 require => Postgresql::User[$user]
113 }
114
115 phpbb_config { "ldap_user":
116 value => "cn=phpbb-friteuse,ou=System Accounts,$dc_suffix",
117 }
118
119 phpbb_config { "ldap_server":
120 value => "ldap.$domain",
121 }
122
123 $ldap_password = extlookup("phpbb_ldap",'x')
124 phpbb_config { "ldap_password":
125 value => $ldap_password,
126 }
127
128 phpbb_config { "ldap_base_dn":
129 value => "ou=People,$dc_suffix",
130 }
131
132 phpbb_config { "auth_method":
133 value => "ldap",
134 }
135
136 phpbb_config { "ldap_mail":
137 value => "mail",
138 }
139
140 phpbb_config { "ldap_uid":
141 value => "uid",
142 }
143
144 phpbb_config { "cookie_domain":
145 value => "forums.$domain",
146 }
147
148 phpbb_config { "server_name":
149 value => "forums.$domain",
150 }
151
152
153 }
154 }

  ViewVC Help
Powered by ViewVC 1.1.30