|
2 | 2 |
|
3 | 3 | include puppet::params |
4 | 4 | include puppet::server::rack |
5 | | - class { 'nginx': } |
| 5 | + include nginx |
6 | 6 |
|
7 | 7 | class { 'puppet::server::standalone': |
8 | 8 | enabled => false, |
|
11 | 11 | Unicorn::App['puppetmaster'], |
12 | 12 | ], |
13 | 13 | } |
| 14 | + Ini_setting { |
| 15 | + ensure => 'present', |
| 16 | + section => 'master', |
| 17 | + path => $puppet::params::puppet_conf, |
| 18 | + } |
| 19 | + ini_setting { |
| 20 | + 'ssl_client_header': |
| 21 | + ensure => present, |
| 22 | + setting => 'ssl_client_header', |
| 23 | + value => 'HTTP_X_CLIENT_DN'; |
| 24 | + 'ssl_client_verify_header': |
| 25 | + ensure => present, |
| 26 | + setting => 'ssl_client_verify_header', |
| 27 | + value => 'HTTP_X_CLIENT_VERIFY'; |
| 28 | + } |
14 | 29 |
|
15 | 30 | $servername = pick($::puppet::server::servername, $::clientcert, $::fqdn) |
16 | 31 | $unicorn_socket = "unix:${puppet::params::puppet_rundir}/puppetmaster_unicorn.sock" |
17 | 32 |
|
18 | 33 | nginx::resource::vhost { 'puppetmaster': |
19 | | - server_name => [$servername], |
20 | | - ssl => true, |
21 | | - ssl_port => '8140', |
22 | | - listen_port => '8140', # force ssl_only by matching ssl_port |
23 | | - ssl_cert => "${::puppet::ssldir}/certs/${servername}.pem", |
24 | | - ssl_key => "${::puppet::ssldir}/private_keys/${servername}.pem", |
25 | | - ssl_ciphers => $::puppet::server::ssl_ciphers, |
26 | | - ssl_protocols => $::puppet::server::ssl_protocols, |
27 | | - proxy_read_timeout => '300', |
28 | | - proxy => "http://puppetmaster_unicorn", |
29 | | - vhost_cfg_append => { |
| 34 | + server_name => [$servername], |
| 35 | + ssl => true, |
| 36 | + ssl_port => '8140', |
| 37 | + listen_port => '8140', # force ssl_only by matching ssl_port |
| 38 | + ssl_cert => "${::puppet::ssldir}/certs/${servername}.pem", |
| 39 | + ssl_key => "${::puppet::ssldir}/private_keys/${servername}.pem", |
| 40 | + ssl_ciphers => $::puppet::server::ssl_ciphers, |
| 41 | + ssl_protocols => $::puppet::server::ssl_protocols, |
| 42 | + use_default_location => false, |
| 43 | + vhost_cfg_append => { |
30 | 44 | ssl_crl => "${::puppet::ssldir}/crl.pem", |
31 | 45 | ssl_client_certificate => "${::puppet::ssldir}/certs/ca.pem", |
32 | 46 | ssl_verify_client => 'optional', |
33 | | - proxy_connect_timeout => '300', |
34 | | - proxy_set_header => [ 'Host $host', 'X-Real-IP $remote_addr', 'X-Forwarded-For $proxy_add_x_forwarded_for', 'X-Client-Verify $ssl_client_verify', 'X-Client-DN $ssl_client_s_dn', 'X-SSL-Issuer $ssl_client_i_dn'], |
| 47 | + proxy_set_header => [ 'Host $host', |
| 48 | + 'X-Real-IP $remote_addr', |
| 49 | + 'X-Forwarded-For $proxy_add_x_forwarded_for', |
| 50 | + 'X-Client-Verify $ssl_client_verify', |
| 51 | + 'X-Client-DN $ssl_client_s_dn', |
| 52 | + 'X-SSL-Issuer $ssl_client_i_dn'], |
35 | 53 | root => '/usr/share/empty', |
36 | 54 | } |
37 | 55 | } |
38 | | - |
| 56 | + nginx::resource::location { 'unicorn_upstream': |
| 57 | + ensure => present, |
| 58 | + location => '/', |
| 59 | + vhost => 'puppetmaster', |
| 60 | + proxy_set_header => [], |
| 61 | + location_custom_cfg => { |
| 62 | + proxy_pass => "http://puppetmaster_unicorn", |
| 63 | + proxy_redirect => 'off', |
| 64 | + proxy_connect_timeout => '90', |
| 65 | + proxy_read_timeout => '300', |
| 66 | + }, |
| 67 | + # this priority sets concat order so that the location is created inside |
| 68 | + # the server block. This works around a possible bug in jfryman/nginx. |
| 69 | + priority => 701, |
| 70 | + } |
39 | 71 | nginx::resource::upstream { 'puppetmaster_unicorn': |
40 | 72 | members => [ |
41 | 73 | $unicorn_socket |
|
0 commit comments