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

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

Issue 29344646: Issue 4073 - Improve Nginx integration with "upstart" service provider (Closed)
Patch Set: Issue 4073 - Address feedback from code-review Created May 27, 2016, 3:32 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 | « no previous file | 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 nginx ( 1 class nginx (
2 $worker_processes = $nginx::params::worker_processes, 2 $worker_processes = $nginx::params::worker_processes,
3 $worker_connections = $nginx::params::worker_connections, 3 $worker_connections = $nginx::params::worker_connections,
4 $ssl_session_cache = $nginx::params::ssl_session_cache, 4 $ssl_session_cache = $nginx::params::ssl_session_cache,
5 $geoip_country = undef, 5 $geoip_country = undef,
6 $geoip_city = undef, 6 $geoip_city = undef,
7 ) inherits nginx::params { 7 ) inherits nginx::params {
8 8
9 apt::ppa {'ppa:nginx/stable': 9 apt::ppa {'ppa:nginx/stable':
10 } 10 }
(...skipping 29 matching lines...) Expand all
40 40
41 Exec { 41 Exec {
42 path => '/usr/bin:/bin', 42 path => '/usr/bin:/bin',
43 logoutput => 'on_failure', 43 logoutput => 'on_failure',
44 } 44 }
45 45
46 46
47 file {'/etc/nginx/nginx.conf': 47 file {'/etc/nginx/nginx.conf':
48 content => template('nginx/nginx.conf.erb'), 48 content => template('nginx/nginx.conf.erb'),
49 require => Package['nginx'], 49 require => Package['nginx'],
50 notify => Service['nginx']
51 } 50 }
52 51
53 file {'/etc/nginx/sites-available': 52 file {'/etc/nginx/sites-available':
54 ensure => directory, 53 ensure => directory,
55 require => Package['nginx'] 54 require => Package['nginx']
56 } 55 }
57 56
58 file {'/etc/nginx/sites-enabled': 57 file {'/etc/nginx/sites-enabled':
59 ensure => directory, 58 ensure => directory,
60 require => Package['nginx'] 59 require => Package['nginx']
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 188
190 $find_chmod_base = [$find_cmd_base, '-not', '-perm', '0640'] 189 $find_chmod_base = [$find_cmd_base, '-not', '-perm', '0640']
191 $find_chmod_exec = ['-ls', '-exec', 'chmod', '0640', '{}', ';'] 190 $find_chmod_exec = ['-ls', '-exec', 'chmod', '0640', '{}', ';']
192 191
193 exec {"set_logfiles_permissions": 192 exec {"set_logfiles_permissions":
194 command => shellquote($find_chmod_base, $find_chmod_exec), 193 command => shellquote($find_chmod_base, $find_chmod_exec),
195 unless => shellquote($find_chmod_base, $find_kill_exec), 194 unless => shellquote($find_chmod_base, $find_kill_exec),
196 subscribe => Service['nginx'], 195 subscribe => Service['nginx'],
197 } 196 }
198 197
198 $restart_command = join([
199 'set -e',
200 'pid=`cat /var/run/nginx.pid`',
201 'kill -USR2 "$pid"',
202 'sleep 1',
203 'kill -QUIT "$pid"',
204 ], "\n")
205
199 service {'nginx': 206 service {'nginx':
200 ensure => running, 207 ensure => running,
201 enable => true, 208 enable => true,
202 restart => '/etc/init.d/nginx reload',
203 hasstatus => true, 209 hasstatus => true,
204 require => File['/etc/nginx/nginx.conf'] 210 require => Package['nginx'],
211 restart => $restart_command,
212 subscribe => File['/etc/nginx/nginx.conf'],
205 } 213 }
206 214
207 file {'/usr/share/nginx/html/50x.html': 215 file {'/usr/share/nginx/html/50x.html':
208 mode => 0644, 216 mode => 0644,
209 owner => 'root', 217 owner => 'root',
210 require => Package['nginx'], 218 require => Package['nginx'],
211 source => 'puppet:///modules/nginx/50x.html', 219 source => 'puppet:///modules/nginx/50x.html',
212 } 220 }
213 } 221 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld