Merge "Add support to override http/https port"

This commit is contained in:
Zuul 2018-05-02 19:17:38 +00:00 committed by Gerrit Code Review
commit bd5eb587fd
3 changed files with 31 additions and 1 deletions

View File

@ -174,6 +174,12 @@
# [*listen_ssl*] # [*listen_ssl*]
# (optional) Enable SSL support in Apache. (Defaults to false) # (optional) Enable SSL support in Apache. (Defaults to false)
# #
# [*http_port*]
# (optional) Port to use for the HTTP virtual host. (Defaults to 80)
#
# [*https_port*]
# (optional) Port to use for the HTTPS virtual host. (Defaults to 443)
#
# [*ssl_no_verify*] # [*ssl_no_verify*]
# (optionsl) Disable SSL hostname verifying. Set it if you don't have # (optionsl) Disable SSL hostname verifying. Set it if you don't have
# properly configured DNS which will resolve hostnames for SSL endpoints # properly configured DNS which will resolve hostnames for SSL endpoints
@ -440,6 +446,8 @@ class horizon(
$server_aliases = $::fqdn, $server_aliases = $::fqdn,
$allowed_hosts = $::fqdn, $allowed_hosts = $::fqdn,
$listen_ssl = false, $listen_ssl = false,
$http_port = 80,
$https_port = 443,
$ssl_no_verify = false, $ssl_no_verify = false,
$ssl_redirect = true, $ssl_redirect = true,
$horizon_cert = undef, $horizon_cert = undef,
@ -601,6 +609,8 @@ class horizon(
servername => $servername, servername => $servername,
server_aliases => $server_aliases, server_aliases => $server_aliases,
listen_ssl => $listen_ssl, listen_ssl => $listen_ssl,
http_port => $http_port,
https_port => $https_port,
ssl_redirect => $ssl_redirect, ssl_redirect => $ssl_redirect,
horizon_cert => $horizon_cert, horizon_cert => $horizon_cert,
horizon_key => $horizon_key, horizon_key => $horizon_key,

View File

@ -0,0 +1,5 @@
---
features:
- |
You can now override the http and https port to horizon by passing integers
to the http_port and https_ports parameters. Default values are still the same.

View File

@ -272,7 +272,6 @@ describe 'horizon' do
end end
end end
context 'with ssl enabled' do context 'with ssl enabled' do
before do before do
params.merge!({ params.merge!({
@ -295,6 +294,22 @@ describe 'horizon' do
end end
end end
context 'with overriden http and https ports' do
before do
params.merge!({
:http_port => 1028,
:https_port => 1029,
})
end
it 'configures apache' do
is_expected.to contain_class('horizon::wsgi::apache').with({
:http_port => 1028,
:https_port => 1029,
})
end
end
context 'with default root_path' do context 'with default root_path' do
it 'configures apache' do it 'configures apache' do
is_expected.to contain_class('horizon::wsgi::apache').with({ is_expected.to contain_class('horizon::wsgi::apache').with({