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

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

Issue 5731052198821888: #1203 - Establish nginx::hostconfig-fragment() directive (Closed)
Patch Set: #1203 - Establish nginx::hostconfig-fragment() directive Created Aug. 13, 2014, 9:49 a.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/nginx/templates/site.erb ('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',
6 $is_default = false) inherits private::trac { 5 $is_default = false) inherits private::trac {
7 6
8 package {['python-mysqldb','python-pip','subversion', 'tofrodos', 'graphviz']: 7 package {['python-mysqldb','python-pip','subversion', 'tofrodos', 'graphviz']:
9 ensure => present 8 ensure => present
10 } 9 }
11 10
12 include nginx, spawn-fcgi 11 include nginx, spawn-fcgi
13 12
14 file {$fcgi_config_dir:
15 ensure => directory,
16 owner => 'root',
17 mode => 755,
18 require => Package['nginx'],
19 }
20
21 nginx::hostconfig {$domain: 13 nginx::hostconfig {$domain:
22 content => "include $fcgi_config_dir/*;",
23 is_default => $is_default, 14 is_default => $is_default,
24 certificate => $certificate, 15 certificate => $certificate,
25 private_key => $private_key, 16 private_key => $private_key,
26 log => 'access_log_trac', 17 log => 'access_log_trac',
27 require => File[$fcgi_config_dir],
28 } 18 }
29 19
30 user {'trac': 20 user {'trac':
31 ensure => present, 21 ensure => present,
32 comment => 'User of the trac installation', 22 comment => 'User of the trac installation',
33 home => '/home/trac', 23 home => '/home/trac',
34 managehome => true 24 managehome => true
35 } 25 }
36 26
37 class {'mysql::server': 27 class {'mysql::server':
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 password => $database_password, 134 password => $database_password,
145 host => 'localhost', 135 host => 'localhost',
146 grant => ['all'], 136 grant => ['all'],
147 charset => 'utf8', 137 charset => 'utf8',
148 collate => 'utf8_bin', 138 collate => 'utf8_bin',
149 require => Class['mysql::server'], 139 require => Class['mysql::server'],
150 } 140 }
151 141
152 $location_base = regsubst($location, '/+$', '') 142 $location_base = regsubst($location, '/+$', '')
153 143
154 file {"${trac::fcgi_config_dir}/${name}.conf": 144 nginx::hostconfig-fragment {"nginx_fragment_$name":
Wladimir Palant 2014/08/14 20:33:50 No need to duplicate "nginx_fragment" in the name
mathias 2014/08/18 10:03:26 Done.
155 ensure => file,
156 owner => 'root',
157 mode => 644,
158 content => template('trac/fcgi.conf.erb'), 145 content => template('trac/fcgi.conf.erb'),
159 require => File[$trac::fcgi_config_dir], 146 domain => $trac::domain,
160 notify => Service['nginx'],
161 } 147 }
162 148
163 exec {"trac_env_${name}": 149 exec {"trac_env_${name}":
164 command => shellquote( 150 command => shellquote(
165 'trac-admin', "/home/trac/$environment", 'initenv', $description, 151 'trac-admin', "/home/trac/$environment", 'initenv', $description,
166 "mysql://trac:${database_password}@localhost:3306/$database"), 152 "mysql://trac:${database_password}@localhost:3306/$database"),
167 logoutput => true, 153 logoutput => true,
168 path => '/usr/bin:/usr/sbin:/bin:/usr/local/bin', 154 path => '/usr/bin:/usr/sbin:/bin:/usr/local/bin',
169 require => [ 155 require => [
170 Exec['install_trac'], 156 Exec['install_trac'],
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 fcgi_app => "/home/trac/htdocs-$name/cgi-bin/trac.fcgi", 223 fcgi_app => "/home/trac/htdocs-$name/cgi-bin/trac.fcgi",
238 socket => "/tmp/${name}-fastcgi.sock", 224 socket => "/tmp/${name}-fastcgi.sock",
239 mode => "0666", 225 mode => "0666",
240 user => trac, 226 user => trac,
241 children => 1, 227 children => 1,
242 require => Exec["deploy_$name"], 228 require => Exec["deploy_$name"],
243 } 229 }
244 } 230 }
245 } 231 }
246 232
OLDNEW
« no previous file with comments | « modules/nginx/templates/site.erb ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld