Skip to content
This repository was archived by the owner on Mar 28, 2019. It is now read-only.

Commit 56ab638

Browse files
committed
make puppet::server::unicorn.pp compatible with voxpupuli/nginx 0.6.0
1 parent 5443f9b commit 56ab638

File tree

5 files changed

+34
-45
lines changed

5 files changed

+34
-45
lines changed

.fixtures.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ fixtures:
1212
unicorn: "ploperations/unicorn"
1313
rack: "ploperations/rack"
1414
bundler: "ploperations/bundler"
15-
nginx: "jfryman/nginx"
15+
nginx: "puppet/nginx"
1616
inifile: "puppetlabs/inifile"
1717
apache: "puppetlabs/apache"
1818
portage: "gentoo/portage"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ and rspec tests.
212212

213213
[puppetlabs-puppetdb]: https://github.com/puppetlabs/puppet-puppetdb
214214
[puppetlabs-apache]: https://github.com/puppetlabs/puppetlabs-apache
215-
[jfryman-nginx]: https://github.com/jfryman/puppet-nginx
215+
[puppet-nginx]: https://github.com/voxpupuli/puppet-nginx
216216
[r10k]: https://github.com/adrienthebo/r10k
217217
[hiera-lookup]: https://docs.puppetlabs.com/hiera/1/puppet.html#automatic-parameter-lookup
218218
[hiera-docs]: https://docs.puppetlabs.com/hiera/1/

manifests/server/unicorn.pp

Lines changed: 29 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
class { 'puppet::server::standalone':
99
enabled => false,
1010
before => [
11-
Nginx::Resource::Vhost['puppetmaster'],
11+
Nginx::Resource::Server['puppetmaster'],
1212
Unicorn::App['puppetmaster'],
1313
],
1414
}
1515

1616
$unicorn_socket = "unix:${puppet::rundir}/puppetmaster_unicorn.sock"
1717

18-
nginx::resource::vhost { 'puppetmaster':
18+
nginx::resource::server { 'puppetmaster':
1919
server_name => [$puppet::server::servername],
2020
listen_ip => $puppet::server::bindaddress,
2121
ssl => true,
@@ -25,34 +25,27 @@
2525
ssl_key => "${puppet::ssldir}/private_keys/${puppet::server::servername}.pem",
2626
ssl_ciphers => $puppet::server::ssl_ciphers,
2727
ssl_protocols => $puppet::server::ssl_protocols,
28+
ssl_crl => "${puppet::ssldir}/crl.pem",
29+
ssl_client_cert => "${puppet::ssldir}/certs/ca.pem",
30+
ssl_verify_client => 'optional',
2831
use_default_location => false,
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_set_header => [ 'Host $host',
34-
'X-Real-IP $remote_addr',
35-
'X-Forwarded-For $proxy_add_x_forwarded_for',
36-
'X-Client-Verify $ssl_client_verify',
37-
'X-Client-DN $ssl_client_s_dn',
38-
'X-SSL-Issuer $ssl_client_i_dn'],
39-
root => '/usr/share/empty',
40-
}
32+
www_root => '/usr/share/empty',
4133
}
4234
nginx::resource::location { 'unicorn_upstream':
43-
ensure => present,
44-
location => '/',
45-
vhost => 'puppetmaster',
46-
proxy_set_header => [],
47-
location_custom_cfg => {
48-
proxy_pass => 'http://puppetmaster_unicorn',
49-
proxy_redirect => 'off',
50-
proxy_connect_timeout => '90',
51-
proxy_read_timeout => '300',
52-
},
53-
# this priority sets concat order so that the location is created inside
54-
# the server block. This works around a possible bug in jfryman/nginx.
55-
priority => 701,
35+
ensure => present,
36+
location => '/',
37+
server => 'puppetmaster',
38+
proxy => 'http://puppetmaster_unicorn',
39+
proxy_redirect => 'off',
40+
proxy_connect_timeout => '90',
41+
proxy_read_timeout => '300',
42+
proxy_set_header => ['Host $host',
43+
'X-Real-IP $remote_addr',
44+
'X-Forwarded-For $proxy_add_x_forwarded_for',
45+
'X-Client-Verify $ssl_client_verify',
46+
'X-Client-DN $ssl_client_s_dn',
47+
'X-SSL-Issuer $ssl_client_i_dn'],
48+
ssl_only => true,
5649
}
5750
nginx::resource::upstream { 'puppetmaster_unicorn':
5851
members => [
@@ -63,19 +56,15 @@
6356
if ! empty( $::puppet::server::external_ca )
6457
{
6558
nginx::resource::location { 'external_certificate_authority_proxy':
66-
ensure => present,
67-
location => '~ ^/.*/certificate.*',
68-
vhost => 'puppetmaster',
69-
proxy_set_header => [],
70-
location_custom_cfg => {
71-
proxy_pass => $puppet::server::external_ca,
72-
proxy_redirect => 'off',
73-
proxy_connect_timeout => '90',
74-
proxy_read_timeout => '300',
75-
},
76-
# this priority sets concat order so that the location is created inside
77-
# the server block. This works around a possible bug in jfryman/nginx.
78-
priority => 701,
59+
ensure => present,
60+
location => '~ ^/.*/certificate.*',
61+
server => 'puppetmaster',
62+
proxy_set_header => [],
63+
proxy => $puppet::server::external_ca,
64+
proxy_redirect => 'off',
65+
proxy_connect_timeout => '90',
66+
proxy_read_timeout => '300',
67+
ssl_only => true,
7968
}
8069
}
8170

metadata.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
"version_requirement": ">= 2.1.0 <3.0.0"
3434
},
3535
{
36-
"name": "jfryman/nginx",
37-
"version_requirement": ">= 0.2.0 <1.0.0"
36+
"name": "voxpupuli/nginx",
37+
"version_requirement": ">= 0.6.0 <1.0.0"
3838
},
3939
{
4040
"name": "puppetlabs/puppetdb",

spec/spec_helper_acceptance.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
mod 'unicorn', :git => 'git://github.com/puppetlabs-operations/puppet-unicorn.git'
4949
mod 'rack', :git => 'git://github.com/puppetlabs-operations/puppet-rack.git'
5050
mod 'bundler', :git => 'git://github.com/puppetlabs-operations/puppet-bundler.git'
51-
mod 'nginx', :git => 'git://github.com/jfryman/puppet-nginx.git', :ref => 'v0.0.10'
51+
mod 'nginx', :git => 'git://github.com/voxpupuli/puppet-nginx.git'
5252
mod 'inifile', :git => 'git://github.com/puppetlabs/puppetlabs-inifile.git'
5353
mod 'apache', :git => 'git://github.com/puppetlabs/puppetlabs-apache.git'
5454
mod 'portage', :git => 'git://github.com/gentoo/puppet-portage.git'

0 commit comments

Comments
 (0)