/[adm]/puppet/modules/phpbb/manifests/init.pp
ViewVC logotype

Annotation of /puppet/modules/phpbb/manifests/init.pp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1152 - (hide annotations) (download)
Mon Feb 21 15:14:53 2011 UTC (13 years, 1 month ago) by misc
File size: 2890 byte(s)
move phpbb_config outside of phpbb::base
1 misc 1053 class phpbb {
2 misc 1147 class base {
3     $db = "phpbb"
4     $user = "phpbb"
5 misc 1053
6 misc 1147 include apache::mod_php
7     include mysql
8 misc 1053
9 misc 1147 package { ["php-gd","php-xml","php-zlib","php-ftp","php-magickwand","php-pgsql" ] :
10     ensure => installed
11     }
12 misc 1053
13 misc 1147 package { "perl-DBD-Pg":
14     ensure => installed
15     }
16 misc 1053
17 misc 1147 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 misc 1053
25 misc 1147 # 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 misc 1053
34 misc 1147 $forums_dir = "/var/www/forums/"
35     file { "$forums_dir":
36     ensure => directory,
37     owner => root,
38     group => root,
39     }
40 misc 1075 }
41    
42 misc 1152 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 misc 1151
54     # TODO find a way to avoid all the phpbb::base prefix
55     define instance() {
56 misc 1148 $lang = $name
57 misc 1151 $database = "${phpbb::base::db}_$lang"
58    
59 misc 1147 include git::client
60 misc 1150 include phpbb::base
61 misc 1075
62 misc 1147 exec { "git clone git://git.$domain/forum/ $lang":
63     cwd => $forums_dir,
64     creates => "$forums_dir/$lang",
65     }
66 misc 1075
67 misc 1147 file { "$forums_dir/$lang/phpBB/config.php":
68     ensure => present,
69     owner => root,
70     group => root,
71     mode => 644,
72     content => template("phpbb/config.php"),
73     }
74 misc 1075
75    
76 misc 1147 @@postgresql::database { $database:
77     description => "Phpbb database",
78     user => $user,
79     require => Postgresql::User[$user]
80     }
81 misc 1053
82 misc 1149 # TODO server_name => forums.$domain
83     # cookie_domain => forums.$domain
84     # auth_method => ldap
85     # ldap_uid => uid
86     # ldap_mail => mail
87 misc 1147 phpbb_config { "ldap_user":
88     value => "cn=phpbb-friteuse,ou=System Accounts,$dc_suffix",
89     }
90    
91     phpbb_config { "ldap_server":
92     value => "ldap.$domain",
93     }
94    
95     $ldap_password = extlookup("phpbb_ldap",'x')
96     phpbb_config { "ldap_password":
97     value => $ldap_password,
98     }
99    
100     phpbb_config { "ldap_base_dn":
101     value => "ou=People,$dc_suffix",
102     }
103 misc 1072 }
104 misc 1053 }

  ViewVC Help
Powered by ViewVC 1.1.30