OLD | NEW |
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 Loading... |
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 => 'root', |
| 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 Loading... |
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\nimport trac_performance_fix", |
| 264 require => Exec["deploy_$name"], |
| 265 } |
| 266 |
249 file {"/home/trac/htdocs-$name/htdocs/common/logo.png": | 267 file {"/home/trac/htdocs-$name/htdocs/common/logo.png": |
250 ensure => present, | 268 ensure => present, |
251 source => $logo, | 269 source => $logo, |
252 owner => trac, | 270 owner => trac, |
253 require => Exec["deploy_$name"], | 271 require => Exec["deploy_$name"], |
254 } | 272 } |
255 | 273 |
256 spawn-fcgi::pool {"tracd_${name}": | 274 spawn-fcgi::pool {"tracd_${name}": |
257 ensure => present, | 275 ensure => present, |
258 fcgi_app => "/home/trac/htdocs-$name/cgi-bin/trac.fcgi", | 276 fcgi_app => "/home/trac/htdocs-$name/cgi-bin/trac.fcgi", |
(...skipping 13 matching lines...) Expand all Loading... |
272 # Daily restart required for log rotation of all instances at once | 290 # Daily restart required for log rotation of all instances at once |
273 cron {'restart-trac-daily': | 291 cron {'restart-trac-daily': |
274 command => 'service spawn-fcgi restart >/tmp/spawn-fcgi-restart.log', | 292 command => 'service spawn-fcgi restart >/tmp/spawn-fcgi-restart.log', |
275 environment => hiera('cron::environment', []), | 293 environment => hiera('cron::environment', []), |
276 hour => '1', | 294 hour => '1', |
277 minute => '0', | 295 minute => '0', |
278 user => 'root', | 296 user => 'root', |
279 } | 297 } |
280 } | 298 } |
281 | 299 |
OLD | NEW |