/[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 1168 - (show annotations) (download)
Tue Feb 22 01:04:19 2011 UTC (13 years, 1 month ago) by misc
File size: 3795 byte(s)
- set cache as writable by apache user
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 }
43
44 define phpbb_config($value) {
45 exec { "/usr/local/bin/phpbb_apply_config.pl $name":
46 user => root,
47 environment => ["PGDATABASE=$phpbb::base::database",
48 "PGUSER=$phpbb::base::user",
49 "PGPASSWORD=$phpbb::base::pgsql_password",
50 "PGHOST=pgsql.$domain",
51 "VALUE=$value"],
52 require => File["/usr/local/bin/phpbb_apply_config.pl"],
53 }
54 }
55
56 # TODO find a way to avoid all the phpbb::base prefix
57 define instance() {
58 include phpbb::base
59
60 $lang = $name
61 $database = "${phpbb::base::db}_$lang"
62
63 $user = $phpbb::base::user
64 $pgsql_password = $phpbb::base::pgsql_password
65 $forums_dir = $phpbb::base::forums_dir
66
67 include git::client
68 exec { "git_clone $lang":
69 command =>"git clone git://git.$domain/forum/ $lang",
70 cwd => $forums_dir,
71 creates => "$forums_dir/$lang",
72 require => File["$forums_dir"]
73 }
74
75 # TODO manage the permission of the various subdirectories
76 $writable_dir = ['cache']
77 file { "$forums_dir/$lang/phpBB/$writable_dir":
78 ensure => directory,
79 owner => apache,
80 group => root,
81 mode => 755,
82 require => Exec["git_clone $lang"],
83 }
84
85 file { "$forums_dir/$lang/phpBB/config.php":
86 ensure => present,
87 owner => root,
88 group => root,
89 mode => 644,
90 content => template("phpbb/config.php"),
91 }
92
93
94 @@postgresql::database { $database:
95 description => "Phpbb database",
96 user => $user,
97 require => Postgresql::User[$user]
98 }
99
100 phpbb_config { "ldap_user":
101 value => "cn=phpbb-friteuse,ou=System Accounts,$dc_suffix",
102 }
103
104 phpbb_config { "ldap_server":
105 value => "ldap.$domain",
106 }
107
108 $ldap_password = extlookup("phpbb_ldap",'x')
109 phpbb_config { "ldap_password":
110 value => $ldap_password,
111 }
112
113 phpbb_config { "ldap_base_dn":
114 value => "ou=People,$dc_suffix",
115 }
116
117 phpbb_config { "auth_method":
118 value => "ldap",
119 }
120
121 phpbb_config { "ldap_mail":
122 value => "mail",
123 }
124
125 phpbb_config { "ldap_uid":
126 value => "uid",
127 }
128
129 phpbb_config { "cookie_domain":
130 value => "forums.$domain",
131 }
132
133 phpbb_config { "server_name":
134 value => "forums.$domain",
135 }
136
137
138 }
139 }

  ViewVC Help
Powered by ViewVC 1.1.30