/[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 1151 - (show annotations) (download)
Mon Feb 21 15:14:52 2011 UTC (13 years, 2 months ago) by misc
File size: 2764 byte(s)
rename the php_instance class, as it is already scoped in phpbb module
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 # 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 }
36
37 $pgsql_password = extlookup("phpbb_pgsql",'x')
38 @@postgresql::user { $user:
39 password => $pgsql_password,
40 }
41
42 $forums_dir = "/var/www/forums/"
43 file { "$forums_dir":
44 ensure => directory,
45 owner => root,
46 group => root,
47 }
48 }
49
50
51 # TODO find a way to avoid all the phpbb::base prefix
52 define instance() {
53 $lang = $name
54 $database = "${phpbb::base::db}_$lang"
55
56 include git::client
57 include phpbb::base
58
59 exec { "git clone git://git.$domain/forum/ $lang":
60 cwd => $forums_dir,
61 creates => "$forums_dir/$lang",
62 }
63
64 file { "$forums_dir/$lang/phpBB/config.php":
65 ensure => present,
66 owner => root,
67 group => root,
68 mode => 644,
69 content => template("phpbb/config.php"),
70 }
71
72
73 @@postgresql::database { $database:
74 description => "Phpbb database",
75 user => $user,
76 require => Postgresql::User[$user]
77 }
78
79 # TODO server_name => forums.$domain
80 # cookie_domain => forums.$domain
81 # auth_method => ldap
82 # ldap_uid => uid
83 # ldap_mail => mail
84 phpbb_config { "ldap_user":
85 value => "cn=phpbb-friteuse,ou=System Accounts,$dc_suffix",
86 }
87
88 phpbb_config { "ldap_server":
89 value => "ldap.$domain",
90 }
91
92 $ldap_password = extlookup("phpbb_ldap",'x')
93 phpbb_config { "ldap_password":
94 value => $ldap_password,
95 }
96
97 phpbb_config { "ldap_base_dn":
98 value => "ou=People,$dc_suffix",
99 }
100 }
101 }

  ViewVC Help
Powered by ViewVC 1.1.30