LEFT | RIGHT |
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 Loading... |
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'] |
50 } | 51 } |
51 | 52 |
52 file {'/etc/nginx/sites-available': | 53 file {'/etc/nginx/sites-available': |
53 ensure => directory, | 54 ensure => directory, |
54 require => Package['nginx'] | 55 require => Package['nginx'] |
55 } | 56 } |
56 | 57 |
57 file {'/etc/nginx/sites-enabled': | 58 file {'/etc/nginx/sites-enabled': |
58 ensure => directory, | 59 ensure => directory, |
59 require => Package['nginx'] | 60 require => Package['nginx'] |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 exec {"set_logfiles_permissions": | 193 exec {"set_logfiles_permissions": |
193 command => shellquote($find_chmod_base, $find_chmod_exec), | 194 command => shellquote($find_chmod_base, $find_chmod_exec), |
194 unless => shellquote($find_chmod_base, $find_kill_exec), | 195 unless => shellquote($find_chmod_base, $find_kill_exec), |
195 subscribe => Service['nginx'], | 196 subscribe => Service['nginx'], |
196 } | 197 } |
197 | 198 |
198 $restart_command = join([ | 199 $restart_command = join([ |
199 'set -e', | 200 'set -e', |
200 'pid=`cat /var/run/nginx.pid`', | 201 'pid=`cat /var/run/nginx.pid`', |
201 'kill -USR2 "$pid"', | 202 'kill -USR2 "$pid"', |
202 'sleep 1', | 203 'sleep 2', |
203 'kill -QUIT "$pid"', | 204 'kill -QUIT "$pid"', |
204 ], "\n") | 205 ], "\n") |
205 | 206 |
206 service {'nginx': | 207 service {'nginx': |
207 ensure => running, | 208 ensure => running, |
208 enable => true, | 209 enable => true, |
| 210 restart => $restart_command, |
209 hasstatus => true, | 211 hasstatus => true, |
210 require => Package['nginx'], | 212 require => Package['nginx'], |
211 restart => $restart_command, | |
212 subscribe => File['/etc/nginx/nginx.conf'], | |
213 } | 213 } |
214 | 214 |
215 file {'/usr/share/nginx/html/50x.html': | 215 file {'/usr/share/nginx/html/50x.html': |
216 mode => 0644, | 216 mode => 0644, |
217 owner => 'root', | 217 owner => 'root', |
218 require => Package['nginx'], | 218 require => Package['nginx'], |
219 source => 'puppet:///modules/nginx/50x.html', | 219 source => 'puppet:///modules/nginx/50x.html', |
220 } | 220 } |
221 } | 221 } |
LEFT | RIGHT |