/[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 1153 - (show annotations) (download)
Mon Feb 21 15:14:54 2011 UTC (13 years, 1 month ago) by misc
File size: 3027 byte(s)
since phpbb::instance is outside of phpbb::base, the variables are no longer in the scope ( TODO find a cleaner way, I am too sick for this now )
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 $pgsql_password = extlookup("phpbb_pgsql",'x')
30 @@postgresql::user { $user:
31 password => $pgsql_password,
32 }
33
34 $forums_dir = "/var/www/forums/"
35 file { "$forums_dir":
36 ensure => directory,
37 owner => root,
38 group => root,
39 }
40 }
41
42 define phpbb_config($value) {
43 exec { "/usr/local/bin/phpbb_apply_config.pl $name":
44 user => root,
45 environment => ["PGDATABASE=$phpbb::base::database",
46 "PGUSER=$phpbb::base::user",
47 "PGPASSWORD=$phpbb::base::pgsql_password",
48 "PGHOST=pgsql.$domain",
49 "VALUE=$value"],
50 require => File["/usr/local/bin/phpbb_apply_config.pl"],
51 }
52 }
53
54 # TODO find a way to avoid all the phpbb::base prefix
55 define instance() {
56 $lang = $name
57 $database = "${phpbb::base::db}_$lang"
58
59 include git::client
60 include phpbb::base
61 $user = $phpbb::base::user
62 $pgsql_password = $phpbb::base::pgsql_password
63 $forums_dir = $phpbb::base::forums_dir
64
65 exec { "git clone git://git.$domain/forum/ $lang":
66 cwd => $forums_dir,
67 creates => "$forums_dir/$lang",
68 }
69
70 file { "$forums_dir/$lang/phpBB/config.php":
71 ensure => present,
72 owner => root,
73 group => root,
74 mode => 644,
75 content => template("phpbb/config.php"),
76 }
77
78
79 @@postgresql::database { $database:
80 description => "Phpbb database",
81 user => $user,
82 require => Postgresql::User[$user]
83 }
84
85 # TODO server_name => forums.$domain
86 # cookie_domain => forums.$domain
87 # auth_method => ldap
88 # ldap_uid => uid
89 # ldap_mail => mail
90 phpbb_config { "ldap_user":
91 value => "cn=phpbb-friteuse,ou=System Accounts,$dc_suffix",
92 }
93
94 phpbb_config { "ldap_server":
95 value => "ldap.$domain",
96 }
97
98 $ldap_password = extlookup("phpbb_ldap",'x')
99 phpbb_config { "ldap_password":
100 value => $ldap_password,
101 }
102
103 phpbb_config { "ldap_base_dn":
104 value => "ou=People,$dc_suffix",
105 }
106 }
107 }

  ViewVC Help
Powered by ViewVC 1.1.30