/[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 1170 - (hide annotations) (download)
Tue Feb 22 01:14:40 2011 UTC (13 years, 1 month ago) by misc
File size: 4399 byte(s)
- offer a ssl version of the forum, for login

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 $pgsql_password = extlookup("phpbb_pgsql",'x')
26     @@postgresql::user { $user:
27     password => $pgsql_password,
28     }
29 misc 1053
30 misc 1147 $forums_dir = "/var/www/forums/"
31     file { "$forums_dir":
32     ensure => directory,
33     owner => root,
34     group => root,
35     }
36 misc 1158 # TODO add a ssl counterpart
37     # TODO check that everything is locked down
38 misc 1156 apache::vhost_base { "forums.$domain":
39     content => template("phpbb/forums_vhost.conf"),
40     }
41    
42 misc 1170 apache::vhost_base { "ssl_forums.$domain":
43     use_ssl => true,
44     vhost => "forums.$domain",
45     content => template("phpbb/forums_vhost.conf"),
46     }
47    
48 misc 1075 }
49    
50 misc 1152 define phpbb_config($value) {
51     exec { "/usr/local/bin/phpbb_apply_config.pl $name":
52     user => root,
53     environment => ["PGDATABASE=$phpbb::base::database",
54     "PGUSER=$phpbb::base::user",
55     "PGPASSWORD=$phpbb::base::pgsql_password",
56     "PGHOST=pgsql.$domain",
57     "VALUE=$value"],
58     require => File["/usr/local/bin/phpbb_apply_config.pl"],
59     }
60     }
61 misc 1151
62     # TODO find a way to avoid all the phpbb::base prefix
63     define instance() {
64 misc 1161 include phpbb::base
65    
66 misc 1148 $lang = $name
67 misc 1151 $database = "${phpbb::base::db}_$lang"
68    
69 misc 1153 $user = $phpbb::base::user
70     $pgsql_password = $phpbb::base::pgsql_password
71     $forums_dir = $phpbb::base::forums_dir
72 misc 1075
73 misc 1161 include git::client
74 misc 1167 exec { "git_clone $lang":
75     command =>"git clone git://git.$domain/forum/ $lang",
76 misc 1147 cwd => $forums_dir,
77 misc 1154 creates => "$forums_dir/$lang",
78 misc 1169 require => File["$forums_dir"],
79     notify => "rm_install $lang",
80 misc 1147 }
81 misc 1075
82 misc 1169 # remove this or the forum will not work ( 'board disabled' )
83     # maybe it would be better to move this elsehwere, I
84     # am not sure ( and in any case, that's still in git )
85     exec { "rm_install $lang":
86     command => "rm -Rf $forums_dir/$lang/phpBB/install":
87     onlyif => "test -d $forums_dir/$lang/phpBB/install",
88     }
89    
90 misc 1168 # TODO manage the permission of the various subdirectories
91     $writable_dir = ['cache']
92     file { "$forums_dir/$lang/phpBB/$writable_dir":
93     ensure => directory,
94     owner => apache,
95     group => root,
96     mode => 755,
97     require => Exec["git_clone $lang"],
98     }
99    
100 misc 1147 file { "$forums_dir/$lang/phpBB/config.php":
101     ensure => present,
102     owner => root,
103     group => root,
104     mode => 644,
105     content => template("phpbb/config.php"),
106     }
107 misc 1075
108    
109 misc 1147 @@postgresql::database { $database:
110     description => "Phpbb database",
111     user => $user,
112     require => Postgresql::User[$user]
113     }
114 misc 1053
115 misc 1147 phpbb_config { "ldap_user":
116     value => "cn=phpbb-friteuse,ou=System Accounts,$dc_suffix",
117     }
118    
119     phpbb_config { "ldap_server":
120     value => "ldap.$domain",
121     }
122    
123     $ldap_password = extlookup("phpbb_ldap",'x')
124     phpbb_config { "ldap_password":
125     value => $ldap_password,
126     }
127    
128     phpbb_config { "ldap_base_dn":
129     value => "ou=People,$dc_suffix",
130     }
131 misc 1158
132     phpbb_config { "auth_method":
133     value => "ldap",
134     }
135    
136     phpbb_config { "ldap_mail":
137     value => "mail",
138     }
139    
140     phpbb_config { "ldap_uid":
141     value => "uid",
142     }
143    
144     phpbb_config { "cookie_domain":
145     value => "forums.$domain",
146     }
147    
148     phpbb_config { "server_name":
149     value => "forums.$domain",
150     }
151    
152    
153 misc 1072 }
154 misc 1053 }

  ViewVC Help
Powered by ViewVC 1.1.30