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