OLD | NEW |
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 # Class['ssh'] is assumed to handle SSL-related quirks and therefore | 9 # Class['ssh'] is assumed to handle SSL-related quirks and therefore |
10 # the inclusion here became necessary. | 10 # the inclusion here became necessary. |
11 include ssh | 11 include ssh |
12 | 12 |
13 apt::ppa {'ppa:nginx/stable': | 13 package {'nginx': |
| 14 ensure => 'latest', |
14 } | 15 } |
15 | 16 |
16 apt::source {'nginx': | 17 if $::lsbdistcodename == 'precise' { |
17 ensure => 'absent', | 18 |
| 19 apt::ppa {'ppa:nginx/stable': |
| 20 } |
| 21 |
| 22 apt::source {'nginx': |
| 23 ensure => 'absent', |
| 24 } |
| 25 |
| 26 exec {'purge-nginx': |
| 27 before => Package['nginx'], |
| 28 command => '/usr/bin/apt-get -y purge nginx', |
| 29 logoutput => true, |
| 30 path => '/usr/sbin:/usr/bin:/sbin:/bin', |
| 31 refreshonly => true, |
| 32 returns => [0, 100], |
| 33 subscribe => Apt::Ppa['ppa:nginx/stable'], |
| 34 } |
18 } | 35 } |
19 | 36 |
20 exec {'purge-nginx': | 37 if $::operatingsystem == 'Debian' { |
21 command => '/usr/bin/apt-get -y purge nginx', | |
22 logoutput => true, | |
23 path => '/usr/sbin:/usr/bin:/sbin:/bin', | |
24 refreshonly => true, | |
25 returns => [0, 100], | |
26 subscribe => Apt::Ppa['ppa:nginx/stable'], | |
27 } | |
28 | 38 |
29 package {'nginx': | 39 apt::key {'nginx': |
30 ensure => '1.10.1-3+precise3', | 40 key => 'ABF5BD827BD9BF62', |
31 require => Exec['purge-nginx'], | 41 key_content => template('nginx/apt.key.erb'), |
| 42 } |
| 43 |
| 44 apt::source {'nginx': |
| 45 before => Package['nginx'], |
| 46 location => 'https://nginx.org/packages/mainline/debian/', |
| 47 release => downcase($::lsbdistcodename), |
| 48 repos => 'nginx', |
| 49 require => Apt::Key['nginx'], |
| 50 } |
32 } | 51 } |
33 | 52 |
34 user {'nginx': | 53 user {'nginx': |
35 ensure => 'present', | 54 ensure => 'present', |
36 require => Package['nginx'], | 55 require => Package['nginx'], |
37 } | 56 } |
38 | 57 |
39 File { | 58 File { |
40 owner => root, | 59 owner => root, |
41 group => root, | 60 group => root, |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 | 237 |
219 Service['nginx'] <~ Class['ssh'] | 238 Service['nginx'] <~ Class['ssh'] |
220 | 239 |
221 file {'/usr/share/nginx/html/50x.html': | 240 file {'/usr/share/nginx/html/50x.html': |
222 mode => 0644, | 241 mode => 0644, |
223 owner => 'root', | 242 owner => 'root', |
224 require => Package['nginx'], | 243 require => Package['nginx'], |
225 source => 'puppet:///modules/nginx/50x.html', | 244 source => 'puppet:///modules/nginx/50x.html', |
226 } | 245 } |
227 } | 246 } |
OLD | NEW |