|
2 | 2 |
|
3 | 3 | include puppet::params |
4 | 4 | include puppet::server::rack |
5 | | - include nginx::server |
| 5 | + class { 'nginx': } |
6 | 6 |
|
7 | 7 | class { 'puppet::server::standalone': |
8 | 8 | enabled => false, |
9 | 9 | before => [ |
10 | | - Nginx::Unicorn['puppetmaster'], |
| 10 | + Nginx::Resource::Vhost['puppetmaster'], |
11 | 11 | Unicorn::App['puppetmaster'], |
12 | 12 | ], |
13 | 13 | } |
14 | 14 |
|
15 | 15 | $servername = pick($::puppet::server::servername, $::clientcert, $::fqdn) |
16 | | - $unicorn_socket = "${puppet::params::puppet_rundir}/puppetmaster_unicorn.sock" |
| 16 | + $unicorn_socket = "unix:${puppet::params::puppet_rundir}/puppetmaster_unicorn.sock" |
17 | 17 |
|
18 | | - nginx::unicorn { 'puppetmaster': |
19 | | - servername => $servername, |
20 | | - path => $::puppet::params::puppet_confdir, |
21 | | - unicorn_socket => $unicorn_socket, |
22 | | - ssl => true, |
23 | | - sslonly => true, |
24 | | - ssl_port => '8140', |
25 | | - ssl_cert => "${::puppet::ssldir}/certs/${servername}.pem", |
26 | | - ssl_key => "${::puppet::ssldir}/private_keys/${servername}.pem", |
27 | | - ssl_ca => "${::puppet::ssldir}/certs/ca.pem", |
28 | | - ssl_crl_path => "${::puppet::ssldir}/crl.pem", |
29 | | - ssl_ciphers => $::puppet::server::ssl_ciphers, |
30 | | - ssl_protocols => $::puppet::server::ssl_protocols, |
31 | | - ssl_verify_client => 'optional', |
32 | | - magic => "proxy_connect_timeout 300s;\n proxy_read_timeout 300s;", |
| 18 | + 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 => { |
| 30 | + ssl_crl => "${::puppet::ssldir}/crl.pem", |
| 31 | + ssl_client_certificate => "${::puppet::ssldir}/certs/ca.pem", |
| 32 | + 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'], |
| 35 | + root => '/usr/share/empty', |
| 36 | + } |
| 37 | + } |
| 38 | + |
| 39 | + nginx::resource::upstream { 'puppetmaster_unicorn': |
| 40 | + members => [ |
| 41 | + $unicorn_socket |
| 42 | + ], |
33 | 43 | } |
34 | 44 |
|
35 | 45 | unicorn::app { 'puppetmaster': |
36 | | - approot => $::puppet::params::puppet_confdir, |
37 | | - config_file => "${::puppet::params::puppet_confdir}/unicorn.conf", |
38 | | - pidfile => "${::puppet::params::puppet_rundir}/puppetmaster_unicorn.pid", |
39 | | - socket => $unicorn_socket, |
40 | | - logdir => $::puppet::params::puppet_logdir, |
41 | | - user => 'puppet', |
42 | | - group => 'puppet', |
43 | | - before => Service['nginx'], |
44 | | - subscribe => Concat["${::puppet::params::puppet_confdir}/config.ru"], |
| 46 | + approot => $::puppet::params::puppet_confdir, |
| 47 | + config_file => "${::puppet::params::puppet_confdir}/unicorn.conf", |
| 48 | + pidfile => "${::puppet::params::puppet_rundir}/puppetmaster_unicorn.pid", |
| 49 | + socket => $unicorn_socket, |
| 50 | + logdir => $::puppet::params::puppet_logdir, |
| 51 | + user => 'puppet', |
| 52 | + group => 'puppet', |
| 53 | + before => Service['nginx'], |
| 54 | +# export_home => $::confdir, # uncomment pending https://github.com/puppetlabs-operations/puppet-unicorn/pull/14 |
45 | 55 | } |
46 | 56 | } |
0 commit comments