1 |
class phpbb { |
2 |
$database = "phpbb" |
3 |
$user = "phpbb" |
4 |
|
5 |
include apache::mod_php |
6 |
include mysql |
7 |
|
8 |
package { ["php-gd","php-xml","php-zlib","php-ftp","php-magickwand" ] : |
9 |
ensure => installed |
10 |
} |
11 |
|
12 |
package { "perl-DBD-Pg": |
13 |
ensure => installed |
14 |
} |
15 |
|
16 |
file { "/usr/local/bin/phpbb_apply_config.pl": |
17 |
ensure => present, |
18 |
owner => root, |
19 |
group => root, |
20 |
mode => 755, |
21 |
source => 'puppet:///modules/phpbb/phpbb_apply_config.pl', |
22 |
} |
23 |
|
24 |
# TODO phpbb config |
25 |
# cookie_domain |
26 |
# board_contact |
27 |
# |
28 |
define phpbb_config($value) { |
29 |
exec { "/usr/local/bin/phpbb_apply_config.pl $name": |
30 |
user => root, |
31 |
environment => "PGDATABASE=$database PGUSER=$user PGPASSWORD=$password PGHOST=pgsql.$domain VALUE=$value", |
32 |
require => File["/usr/local/bin/phpbb_apply_config.pl"], |
33 |
} |
34 |
} |
35 |
|
36 |
phpbb_config { "ldap_user": |
37 |
value => "cn=phpbb-friteuse,ou=System Accounts,$dc_suffix", |
38 |
} |
39 |
|
40 |
phpbb_config { "ldap_server": |
41 |
value => "ldap.$domain", |
42 |
} |
43 |
|
44 |
$ldap_password = extlookup("phpbb_ldap",'x') |
45 |
phpbb_config { "ldap_password": |
46 |
value => $ldap_password, |
47 |
} |
48 |
|
49 |
phpbb_config { "ldap_base_dn": |
50 |
value => "ou=People,$dc_suffix", |
51 |
} |
52 |
|
53 |
|
54 |
|
55 |
# TODO git checkout of the code |
56 |
|
57 |
# TODO phpbb database configuration |
58 |
$pgsql_password = extlookup("phpbb_pgsql",'x') |
59 |
@@postgresql::user { $user: |
60 |
password => $pgsql_password, |
61 |
} |
62 |
|
63 |
@@postgresql::database { $database: |
64 |
description => "Phpbb database", |
65 |
user => $user, |
66 |
require => Postgresql::User[$user] |
67 |
} |
68 |
} |