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 |
# TODO ldap account configuration |
13 |
|
14 |
file { "/usr/local/bin/phpbb_apply_config.pl": |
15 |
ensure => present, |
16 |
owner => root, |
17 |
group => root, |
18 |
mode => 755, |
19 |
source => 'puppet:///modules/phpbb/phpbb_apply_config.pl', |
20 |
} |
21 |
|
22 |
# TODO ldap account configuration |
23 |
# ldap_user |
24 |
# ldap_server |
25 |
# ldap_password ldap_base_dn 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 |
# TODO git checkout |
37 |
|
38 |
$pgsql_password = extlookup("phpbb_pgsql",'x') |
39 |
@@postgresql::user { $user: |
40 |
password => $pgsql_password, |
41 |
} |
42 |
|
43 |
@@postgresql::database { $database: |
44 |
description => "Phpbb database", |
45 |
user => $user, |
46 |
require => Postgresql::User[$user] |
47 |
} |
48 |
} |