1 |
misc |
1053 |
class phpbb { |
2 |
misc |
1147 |
class base { |
3 |
|
|
$db = "phpbb" |
4 |
|
|
$user = "phpbb" |
5 |
misc |
1053 |
|
6 |
misc |
1147 |
include apache::mod_php |
7 |
|
|
include mysql |
8 |
misc |
1053 |
|
9 |
misc |
1147 |
package { ["php-gd","php-xml","php-zlib","php-ftp","php-magickwand","php-pgsql" ] : |
10 |
|
|
ensure => installed |
11 |
|
|
} |
12 |
misc |
1053 |
|
13 |
misc |
1147 |
package { "perl-DBD-Pg": |
14 |
|
|
ensure => installed |
15 |
|
|
} |
16 |
misc |
1053 |
|
17 |
misc |
1147 |
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 |
misc |
1053 |
|
25 |
misc |
1147 |
# TODO phpbb config |
26 |
|
|
# cookie_domain |
27 |
|
|
# board_contact |
28 |
|
|
# |
29 |
|
|
define phpbb_config($value) { |
30 |
|
|
exec { "/usr/local/bin/phpbb_apply_config.pl $name": |
31 |
|
|
user => root, |
32 |
|
|
environment => ["PGDATABASE=$database", "PGUSER=$user", "PGPASSWORD=$pgsql_password", "PGHOST=pgsql.$domain", "VALUE=$value"], |
33 |
|
|
require => File["/usr/local/bin/phpbb_apply_config.pl"], |
34 |
|
|
} |
35 |
misc |
1074 |
} |
36 |
|
|
|
37 |
misc |
1147 |
$pgsql_password = extlookup("phpbb_pgsql",'x') |
38 |
|
|
@@postgresql::user { $user: |
39 |
|
|
password => $pgsql_password, |
40 |
|
|
} |
41 |
misc |
1053 |
|
42 |
misc |
1147 |
$forums_dir = "/var/www/forums/" |
43 |
|
|
file { "$forums_dir": |
44 |
|
|
ensure => directory, |
45 |
|
|
owner => root, |
46 |
|
|
group => root, |
47 |
|
|
} |
48 |
misc |
1075 |
} |
49 |
|
|
|
50 |
misc |
1147 |
define php_instance($lang) { |
51 |
|
|
$database = "${db}_$lang" |
52 |
misc |
1075 |
|
53 |
misc |
1147 |
include git::client |
54 |
misc |
1075 |
|
55 |
misc |
1147 |
exec { "git clone git://git.$domain/forum/ $lang": |
56 |
|
|
cwd => $forums_dir, |
57 |
|
|
creates => "$forums_dir/$lang", |
58 |
|
|
} |
59 |
misc |
1075 |
|
60 |
misc |
1147 |
file { "$forums_dir/$lang/phpBB/config.php": |
61 |
|
|
ensure => present, |
62 |
|
|
owner => root, |
63 |
|
|
group => root, |
64 |
|
|
mode => 644, |
65 |
|
|
content => template("phpbb/config.php"), |
66 |
|
|
} |
67 |
misc |
1075 |
|
68 |
misc |
1147 |
include php::base |
69 |
misc |
1075 |
|
70 |
misc |
1147 |
@@postgresql::database { $database: |
71 |
|
|
description => "Phpbb database", |
72 |
|
|
user => $user, |
73 |
|
|
require => Postgresql::User[$user] |
74 |
|
|
} |
75 |
misc |
1053 |
|
76 |
misc |
1147 |
|
77 |
|
|
phpbb_config { "ldap_user": |
78 |
|
|
value => "cn=phpbb-friteuse,ou=System Accounts,$dc_suffix", |
79 |
|
|
} |
80 |
|
|
|
81 |
|
|
phpbb_config { "ldap_server": |
82 |
|
|
value => "ldap.$domain", |
83 |
|
|
} |
84 |
|
|
|
85 |
|
|
$ldap_password = extlookup("phpbb_ldap",'x') |
86 |
|
|
phpbb_config { "ldap_password": |
87 |
|
|
value => $ldap_password, |
88 |
|
|
} |
89 |
|
|
|
90 |
|
|
phpbb_config { "ldap_base_dn": |
91 |
|
|
value => "ou=People,$dc_suffix", |
92 |
|
|
} |
93 |
misc |
1072 |
} |
94 |
misc |
1053 |
} |