Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: modules/trac/manifests/init.pp

Issue 29362580: Issue 4641 - Append performance fix to trac cgi file (Closed)
Patch Set: Issue 4641 - Performance fix to trac cgi file Created Nov. 17, 2016, 9:36 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « modules/trac/files/trac_performance_fix.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
148 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 => 'trac',
156 mode => 644,
157 }
158
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
158 $database_password = $private::trac::database_password 169 $database_password = $private::trac::database_password
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
260 file_line { "patch $name trac.fcgi":
261 path => "/home/trac/htdocs-$name/cgi-bin/trac.fcgi",
262 match => '^# Author.*$',
263 line => "# Author: Jonas Borgström <jonas@edgewall.com>
264 import trac_performance_fix",
265 require => Exec["deploy_$name"],
266 }
267
249 file {"/home/trac/htdocs-$name/htdocs/common/logo.png": 268 file {"/home/trac/htdocs-$name/htdocs/common/logo.png":
250 ensure => present, 269 ensure => present,
251 source => $logo, 270 source => $logo,
252 owner => trac, 271 owner => trac,
253 require => Exec["deploy_$name"], 272 require => Exec["deploy_$name"],
254 } 273 }
255 274
256 spawn-fcgi::pool {"tracd_${name}": 275 spawn-fcgi::pool {"tracd_${name}":
257 ensure => present, 276 ensure => present,
258 fcgi_app => "/home/trac/htdocs-$name/cgi-bin/trac.fcgi", 277 fcgi_app => "/home/trac/htdocs-$name/cgi-bin/trac.fcgi",
(...skipping 13 matching lines...) Expand all
272 # Daily restart required for log rotation of all instances at once 291 # Daily restart required for log rotation of all instances at once
273 cron {'restart-trac-daily': 292 cron {'restart-trac-daily':
274 command => 'service spawn-fcgi restart >/tmp/spawn-fcgi-restart.log', 293 command => 'service spawn-fcgi restart >/tmp/spawn-fcgi-restart.log',
275 environment => hiera('cron::environment', []), 294 environment => hiera('cron::environment', []),
276 hour => '1', 295 hour => '1',
277 minute => '0', 296 minute => '0',
278 user => 'root', 297 user => 'root',
279 } 298 }
280 } 299 }
281 300
OLDNEW
« no previous file with comments | « modules/trac/files/trac_performance_fix.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld