Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 class trac( | 1 class trac( |
2 $domain, | 2 $domain, |
3 $certificate, | 3 $certificate, |
4 $private_key, | 4 $private_key, |
5 $fcgi_config_dir = '/etc/nginx/trac.d', | 5 $fcgi_config_dir = '/etc/nginx/trac.d', |
6 $is_default = false) inherits private::trac { | 6 $is_default = false) inherits private::trac { |
7 | 7 |
8 package {['python-mysqldb','python-pip','subversion', 'tofrodos', 'graphviz']: | 8 package {['python-mysqldb','python-pip','subversion', 'tofrodos', 'graphviz']: |
9 ensure => present | 9 ensure => present |
10 } | 10 } |
11 | 11 |
12 include nginx, spawn-fcgi | 12 include stdlib, |
13 nginx, | |
14 spawn-fcgi | |
13 | 15 |
14 file {$fcgi_config_dir: | 16 file {$fcgi_config_dir: |
15 ensure => directory, | 17 ensure => directory, |
16 owner => 'root', | 18 owner => 'root', |
17 mode => 755, | 19 mode => 755, |
18 require => Package['nginx'], | 20 require => Package['nginx'], |
19 } | 21 } |
20 | 22 |
21 nginx::hostconfig {$domain: | 23 nginx::hostconfig {$domain: |
22 content => "include $fcgi_config_dir/*;", | 24 content => "include $fcgi_config_dir/*;", |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
138 owner => 'trac', | 140 owner => 'trac', |
139 mode => 644, | 141 mode => 644, |
140 } | 142 } |
141 | 143 |
142 file {'/home/trac/robots.txt': | 144 file {'/home/trac/robots.txt': |
143 ensure => 'present', | 145 ensure => 'present', |
144 source => 'puppet:///modules/trac/robots.txt', | 146 source => 'puppet:///modules/trac/robots.txt', |
145 owner => 'trac', | 147 owner => 'trac', |
146 mode => 644, | 148 mode => 644, |
147 } | 149 } |
150 | |
151 file {"trac_performance_fix_py": | |
152 ensure => present, | |
153 path => '/usr/local/lib/python2.7/dist-packages/trac_performance_fix.py', | |
154 source => 'puppet:///modules/trac/trac_performance_fix.py', | |
155 owner => 'root', | |
156 mode => 644, | |
157 } | |
158 | |
148 | 159 |
149 define instance ( | 160 define instance ( |
150 $config = 'trac/trac.ini.erb', | 161 $config = 'trac/trac.ini.erb', |
151 $description = 'Issue Tracker', | 162 $description = 'Issue Tracker', |
152 $location = '/', | 163 $location = '/', |
153 $logo = 'puppet:///modules/trac/logo.png', | 164 $logo = 'puppet:///modules/trac/logo.png', |
154 $database = 'trac', | 165 $database = 'trac', |
155 $permissions = 'puppet:///modules/trac/permissions.csv', | 166 $permissions = 'puppet:///modules/trac/permissions.csv', |
156 $theme = 'puppet:///modules/trac/theme.css') { | 167 $theme = 'puppet:///modules/trac/theme.css') { |
157 | 168 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
226 Exec['install_TicketTemplate'], | 237 Exec['install_TicketTemplate'], |
227 Exec['install_NeverNotifyUpdater'], | 238 Exec['install_NeverNotifyUpdater'], |
228 Exec['install_MasterTickets'], | 239 Exec['install_MasterTickets'], |
229 Exec['install_ThemeEngine'], | 240 Exec['install_ThemeEngine'], |
230 Exec['install_Tractags'], | 241 Exec['install_Tractags'], |
231 Exec['install_TracSpamFilter'], | 242 Exec['install_TracSpamFilter'], |
232 Exec['install_PrivateTickets'], | 243 Exec['install_PrivateTickets'], |
233 Exec['install_TracXMLRPC'], | 244 Exec['install_TracXMLRPC'], |
234 Exec['install_TracHTTPAuth']], | 245 Exec['install_TracHTTPAuth']], |
235 } | 246 } |
236 | 247 |
237 exec {"deploy_$name": | 248 exec {"deploy_$name": |
238 command => "trac-admin /home/trac/$environment \ | 249 command => "trac-admin /home/trac/$environment \ |
239 deploy /home/trac/htdocs-$name \ | 250 deploy /home/trac/htdocs-$name \ |
240 && fromdos /home/trac/htdocs-$name/cgi-bin/trac.fcgi \ | 251 && fromdos /home/trac/htdocs-$name/cgi-bin/trac.fcgi \ |
241 && chmod 755 /home/trac/htdocs-$name/cgi-bin/trac.fcgi", | 252 && chmod 755 /home/trac/htdocs-$name/cgi-bin/trac.fcgi", |
242 user => trac, | 253 user => trac, |
243 path => '/usr/bin:/usr/sbin:/bin:/usr/local/bin', | 254 path => '/usr/bin:/usr/sbin:/bin:/usr/local/bin', |
244 require => [ | 255 require => [ |
245 Exec["update_env_$name"], | 256 Exec["update_env_$name"], |
246 Package["tofrodos"]], | 257 Package["tofrodos"]], |
247 } | 258 } |
248 | 259 |
249 file {"/home/trac/htdocs-$name/cgi-bin/trac_performance_fix.snippet": | 260 file_line { "patch $name trac.fcgi": |
mathias
2016/11/17 07:43:31
Why not using a target path like /usr/local/lib/py
f.nicolaisen
2016/11/17 08:23:46
Nice. Yeah, we can try doing that instead of exec/
mathias
2016/11/17 10:18:33
It should be possible, something like this one:
f.nicolaisen
2016/11/17 10:54:31
OK, I'll try. Thanks!
| |
250 ensure => present, | 261 path => "/home/trac/htdocs-$name/cgi-bin/trac.fcgi", |
251 source => 'puppet:///modules/trac/trac_performance_fix.snippet', | 262 match => '^# Author.*$', |
252 owner => trac, | 263 line => "# Author\nimport trac_performance_fix", |
253 require => Exec["deploy_$name"], | 264 require => Exec["deploy_$name"], |
254 } | |
255 | |
256 exec {"append_cgi_config_to_$name": | |
mathias
2016/11/17 07:43:31
It isn't really appending any more.
f.nicolaisen
2016/11/17 08:23:46
True that, will fix.
| |
257 command => "sed -i '/# Author: Jonas Borgström <jonas@edgewall.com> /r trac_performance_fix.snippet' trac.fcgi", | |
258 cwd => "/home/trac/htdocs-$name/cgi-bin/", | |
259 user => trac, | |
260 path => '/usr/bin:/usr/sbin:/bin:/usr/local/bin', | |
261 require => File["/home/trac/htdocs-$name/cgi-bin/trac_performance_f ix.snippet"], | |
Wladimir Palant
2016/11/16 17:02:52
This should also require Exec["deploy_$name"], it
f.nicolaisen
2016/11/16 17:04:55
The File has that require, so this is transitively
Wladimir Palant
2016/11/16 18:57:32
Ah, I didn't notice this.
| |
262 } | 265 } |
263 | 266 |
264 file {"/home/trac/htdocs-$name/htdocs/common/logo.png": | 267 file {"/home/trac/htdocs-$name/htdocs/common/logo.png": |
265 ensure => present, | 268 ensure => present, |
266 source => $logo, | 269 source => $logo, |
267 owner => trac, | 270 owner => trac, |
268 require => Exec["deploy_$name"], | 271 require => Exec["deploy_$name"], |
269 } | 272 } |
270 | 273 |
271 spawn-fcgi::pool {"tracd_${name}": | 274 spawn-fcgi::pool {"tracd_${name}": |
(...skipping 15 matching lines...) Expand all Loading... | |
287 # Daily restart required for log rotation of all instances at once | 290 # Daily restart required for log rotation of all instances at once |
288 cron {'restart-trac-daily': | 291 cron {'restart-trac-daily': |
289 command => 'service spawn-fcgi restart >/tmp/spawn-fcgi-restart.log', | 292 command => 'service spawn-fcgi restart >/tmp/spawn-fcgi-restart.log', |
290 environment => hiera('cron::environment', []), | 293 environment => hiera('cron::environment', []), |
291 hour => '1', | 294 hour => '1', |
292 minute => '0', | 295 minute => '0', |
293 user => 'root', | 296 user => 'root', |
294 } | 297 } |
295 } | 298 } |
296 | 299 |
LEFT | RIGHT |