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

make puppet::server::unicorn.pp compatible with voxpupuli/nginx 0.6.0 #233

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fixtures:
unicorn: "ploperations/unicorn"
rack: "ploperations/rack"
bundler: "ploperations/bundler"
nginx: "jfryman/nginx"
nginx: "puppet/nginx"
inifile: "puppetlabs/inifile"
apache: "puppetlabs/apache"
portage: "gentoo/portage"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ and rspec tests.

[puppetlabs-puppetdb]: https://github.com/puppetlabs/puppet-puppetdb
[puppetlabs-apache]: https://github.com/puppetlabs/puppetlabs-apache
[jfryman-nginx]: https://github.com/jfryman/puppet-nginx
[puppet-nginx]: https://github.com/voxpupuli/puppet-nginx
[r10k]: https://github.com/adrienthebo/r10k
[hiera-lookup]: https://docs.puppetlabs.com/hiera/1/puppet.html#automatic-parameter-lookup
[hiera-docs]: https://docs.puppetlabs.com/hiera/1/
Expand Down
69 changes: 29 additions & 40 deletions manifests/server/unicorn.pp
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
class { 'puppet::server::standalone':
enabled => false,
before => [
Nginx::Resource::Vhost['puppetmaster'],
Nginx::Resource::Server['puppetmaster'],
Unicorn::App['puppetmaster'],
],
}

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

nginx::resource::vhost { 'puppetmaster':
nginx::resource::server { 'puppetmaster':
server_name => [$puppet::server::servername],
listen_ip => $puppet::server::bindaddress,
ssl => true,
Expand All @@ -25,34 +25,27 @@
ssl_key => "${puppet::ssldir}/private_keys/${puppet::server::servername}.pem",
ssl_ciphers => $puppet::server::ssl_ciphers,
ssl_protocols => $puppet::server::ssl_protocols,
ssl_crl => "${puppet::ssldir}/crl.pem",
ssl_client_cert => "${puppet::ssldir}/certs/ca.pem",
ssl_verify_client => 'optional',
use_default_location => false,
vhost_cfg_append => {
ssl_crl => "${puppet::ssldir}/crl.pem",
ssl_client_certificate => "${puppet::ssldir}/certs/ca.pem",
ssl_verify_client => 'optional',
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'],
root => '/usr/share/empty',
}
www_root => '/usr/share/empty',
}
nginx::resource::location { 'unicorn_upstream':
ensure => present,
location => '/',
vhost => 'puppetmaster',
proxy_set_header => [],
location_custom_cfg => {
proxy_pass => 'http://puppetmaster_unicorn',
proxy_redirect => 'off',
proxy_connect_timeout => '90',
proxy_read_timeout => '300',
},
# this priority sets concat order so that the location is created inside
# the server block. This works around a possible bug in jfryman/nginx.
priority => 701,
ensure => present,
location => '/',
server => 'puppetmaster',
proxy => 'http://puppetmaster_unicorn',
proxy_redirect => 'off',
proxy_connect_timeout => '90',
proxy_read_timeout => '300',
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'],
ssl_only => true,
}
nginx::resource::upstream { 'puppetmaster_unicorn':
members => [
Expand All @@ -63,19 +56,15 @@
if ! empty( $::puppet::server::external_ca )
{
nginx::resource::location { 'external_certificate_authority_proxy':
ensure => present,
location => '~ ^/.*/certificate.*',
vhost => 'puppetmaster',
proxy_set_header => [],
location_custom_cfg => {
proxy_pass => $puppet::server::external_ca,
proxy_redirect => 'off',
proxy_connect_timeout => '90',
proxy_read_timeout => '300',
},
# this priority sets concat order so that the location is created inside
# the server block. This works around a possible bug in jfryman/nginx.
priority => 701,
ensure => present,
location => '~ ^/.*/certificate.*',
server => 'puppetmaster',
proxy_set_header => [],
proxy => $puppet::server::external_ca,
proxy_redirect => 'off',
proxy_connect_timeout => '90',
proxy_read_timeout => '300',
ssl_only => true,
}
}

Expand Down
4 changes: 2 additions & 2 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
"version_requirement": ">= 2.1.0 <3.0.0"
},
{
"name": "jfryman/nginx",
"version_requirement": ">= 0.2.0 <1.0.0"
"name": "puppet/nginx",
"version_requirement": ">= 0.6.0 <1.0.0"
},
{
"name": "puppetlabs/puppetdb",
Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper_acceptance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
mod 'unicorn', :git => 'git://github.com/puppetlabs-operations/puppet-unicorn.git'
mod 'rack', :git => 'git://github.com/puppetlabs-operations/puppet-rack.git'
mod 'bundler', :git => 'git://github.com/puppetlabs-operations/puppet-bundler.git'
mod 'nginx', :git => 'git://github.com/jfryman/puppet-nginx.git', :ref => 'v0.0.10'
mod 'nginx', :git => 'git://github.com/voxpupuli/puppet-nginx.git'
mod 'inifile', :git => 'git://github.com/puppetlabs/puppetlabs-inifile.git'
mod 'apache', :git => 'git://github.com/puppetlabs/puppetlabs-apache.git'
mod 'portage', :git => 'git://github.com/gentoo/puppet-portage.git'
Expand Down