| 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. |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 } | 51 } |
| 52 | 52 |
| 53 user {'nginx': | 53 user {'nginx': |
| 54 ensure => 'present', | 54 ensure => 'present', |
| 55 require => Package['nginx'], | 55 require => Package['nginx'], |
| 56 } | 56 } |
| 57 | 57 |
| 58 File { | 58 File { |
| 59 owner => root, | 59 owner => root, |
| 60 group => root, | 60 group => root, |
| 61 mode => 0644, | 61 mode => '0644', |
| 62 } | 62 } |
| 63 | 63 |
| 64 Exec { | 64 Exec { |
| 65 path => '/usr/bin:/bin', | 65 path => '/usr/bin:/bin', |
| 66 logoutput => 'on_failure', | 66 logoutput => 'on_failure', |
| 67 } | 67 } |
| 68 | 68 |
| 69 | 69 |
| 70 file {'/etc/nginx/nginx.conf': | 70 file {'/etc/nginx/nginx.conf': |
| 71 content => template('nginx/nginx.conf.erb'), | 71 content => template('nginx/nginx.conf.erb'), |
| (...skipping 12 matching lines...) Expand all Loading... |
| 84 } | 84 } |
| 85 | 85 |
| 86 file {'/var/cache/nginx': | 86 file {'/var/cache/nginx': |
| 87 before => Service['nginx'], | 87 before => Service['nginx'], |
| 88 ensure => directory, | 88 ensure => directory, |
| 89 require => Package['nginx'], | 89 require => Package['nginx'], |
| 90 } | 90 } |
| 91 | 91 |
| 92 @file {'/etc/nginx/dhparam.pem': | 92 @file {'/etc/nginx/dhparam.pem': |
| 93 ensure => 'present', | 93 ensure => 'present', |
| 94 mode => 0600, | 94 mode => '0600', |
| 95 notify => Service['nginx'], | 95 notify => Service['nginx'], |
| 96 require => Package['nginx'], | 96 require => Package['nginx'], |
| 97 source => 'puppet:///modules/private/dhe_rsa_export.pem', | 97 source => 'puppet:///modules/private/dhe_rsa_export.pem', |
| 98 } | 98 } |
| 99 | 99 |
| 100 define hostconfig ( | 100 define hostconfig ( |
| 101 $domain = $title, | 101 $domain = $title, |
| 102 $alt_names = [], | 102 $alt_names = [], |
| 103 $log, | 103 $log, |
| 104 $log_format = 'main', | 104 $log_format = 'main', |
| (...skipping 10 matching lines...) Expand all Loading... |
| 115 require => Package['nginx'], | 115 require => Package['nginx'], |
| 116 notify => Service['nginx'], | 116 notify => Service['nginx'], |
| 117 } | 117 } |
| 118 | 118 |
| 119 if $certificate and $private_key { | 119 if $certificate and $private_key { |
| 120 realize(File['/etc/nginx/dhparam.pem']) | 120 realize(File['/etc/nginx/dhparam.pem']) |
| 121 | 121 |
| 122 if !defined(File["/etc/nginx/${certificate}"]) { | 122 if !defined(File["/etc/nginx/${certificate}"]) { |
| 123 file {"/etc/nginx/${certificate}": | 123 file {"/etc/nginx/${certificate}": |
| 124 ensure => file, | 124 ensure => file, |
| 125 mode => 0400, | 125 mode => '0400', |
| 126 notify => Service['nginx'], | 126 notify => Service['nginx'], |
| 127 before => File["/etc/nginx/sites-available/${domain}"], | 127 before => File["/etc/nginx/sites-available/${domain}"], |
| 128 require => Package['nginx'], | 128 require => Package['nginx'], |
| 129 source => "puppet:///modules/private/${certificate}" | 129 source => "puppet:///modules/private/${certificate}" |
| 130 } | 130 } |
| 131 } | 131 } |
| 132 | 132 |
| 133 if !defined(File["/etc/nginx/${private_key}"]) { | 133 if !defined(File["/etc/nginx/${private_key}"]) { |
| 134 file {"/etc/nginx/${private_key}": | 134 file {"/etc/nginx/${private_key}": |
| 135 ensure => file, | 135 ensure => file, |
| 136 mode => 0400, | 136 mode => '0400', |
| 137 notify => Service['nginx'], | 137 notify => Service['nginx'], |
| 138 before => File["/etc/nginx/sites-available/${domain}"], | 138 before => File["/etc/nginx/sites-available/${domain}"], |
| 139 require => Package['nginx'], | 139 require => Package['nginx'], |
| 140 source => "puppet:///modules/private/${private_key}" | 140 source => "puppet:///modules/private/${private_key}" |
| 141 } | 141 } |
| 142 } | 142 } |
| 143 | 143 |
| 144 if !defined(File["/etc/nginx/sites-available/${certificate}"]) { | 144 if !defined(File["/etc/nginx/sites-available/${certificate}"]) { |
| 145 file {"/etc/nginx/sites-available/${certificate}": | 145 file {"/etc/nginx/sites-available/${certificate}": |
| 146 ensure => absent | 146 ensure => absent |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 ensure => running, | 229 ensure => running, |
| 230 enable => true, | 230 enable => true, |
| 231 restart => $restart_command, | 231 restart => $restart_command, |
| 232 hasstatus => true, | 232 hasstatus => true, |
| 233 require => Package['nginx'], | 233 require => Package['nginx'], |
| 234 } | 234 } |
| 235 | 235 |
| 236 Service['nginx'] <~ Class['ssh'] | 236 Service['nginx'] <~ Class['ssh'] |
| 237 | 237 |
| 238 file {'/usr/share/nginx/html/50x.html': | 238 file {'/usr/share/nginx/html/50x.html': |
| 239 mode => 0644, | 239 mode => '0644', |
| 240 owner => 'root', | 240 owner => 'root', |
| 241 require => Package['nginx'], | 241 require => Package['nginx'], |
| 242 source => 'puppet:///modules/nginx/50x.html', | 242 source => 'puppet:///modules/nginx/50x.html', |
| 243 } | 243 } |
| 244 } | 244 } |
| OLD | NEW |