/[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 1148 - (show annotations) (download)
Mon Feb 21 15:14:48 2011 UTC (13 years, 2 months ago) by misc
File size: 2516 byte(s)
use the name for local
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 define php_instance() {
51 $lang = $name
52 $database = "${db}_$lang"
53
54 include git::client
55
56 exec { "git clone git://git.$domain/forum/ $lang":
57 cwd => $forums_dir,
58 creates => "$forums_dir/$lang",
59 }
60
61 file { "$forums_dir/$lang/phpBB/config.php":
62 ensure => present,
63 owner => root,
64 group => root,
65 mode => 644,
66 content => template("phpbb/config.php"),
67 }
68
69 include php::base
70
71 @@postgresql::database { $database:
72 description => "Phpbb database",
73 user => $user,
74 require => Postgresql::User[$user]
75 }
76
77
78 phpbb_config { "ldap_user":
79 value => "cn=phpbb-friteuse,ou=System Accounts,$dc_suffix",
80 }
81
82 phpbb_config { "ldap_server":
83 value => "ldap.$domain",
84 }
85
86 $ldap_password = extlookup("phpbb_ldap",'x')
87 phpbb_config { "ldap_password":
88 value => $ldap_password,
89 }
90
91 phpbb_config { "ldap_base_dn":
92 value => "ou=People,$dc_suffix",
93 }
94 }
95 }

  ViewVC Help
Powered by ViewVC 1.1.30