From a4cb8367ac86793354902aa55aa60e43e294c6c3 Mon Sep 17 00:00:00 2001 From: Tobias Urdin Date: Thu, 26 Apr 2018 16:07:14 +0200 Subject: [PATCH] Add support to override http/https port Adds support to override the http and/or https ports that is passed down to the horizon::wsgi::apache class. No default values has been changed. Change-Id: I57fd5f3a433c6e123aa0f531630941fabf6ea721 Closes-Bug: 1210719 --- manifests/init.pp | 10 ++++++++++ ...ttp-https-port-to-init-e4924a20fb8cdc40.yaml | 5 +++++ spec/classes/horizon_init_spec.rb | 17 ++++++++++++++++- 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/add-http-https-port-to-init-e4924a20fb8cdc40.yaml diff --git a/manifests/init.pp b/manifests/init.pp index d52ada1a..5edb6b7a 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -174,6 +174,12 @@ # [*listen_ssl*] # (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*] # (optionsl) Disable SSL hostname verifying. Set it if you don't have # properly configured DNS which will resolve hostnames for SSL endpoints @@ -471,6 +477,8 @@ class horizon( $server_aliases = $::fqdn, $allowed_hosts = $::fqdn, $listen_ssl = false, + $http_port = 80, + $https_port = 443, $ssl_no_verify = false, $ssl_redirect = true, $horizon_cert = undef, @@ -659,6 +667,8 @@ settings_local.py and parameter server_aliases for setting ServerAlias directive servername => $servername, server_aliases => $final_server_aliases, listen_ssl => $listen_ssl, + http_port => $http_port, + https_port => $https_port, ssl_redirect => $ssl_redirect, horizon_cert => $horizon_cert, horizon_key => $horizon_key, diff --git a/releasenotes/notes/add-http-https-port-to-init-e4924a20fb8cdc40.yaml b/releasenotes/notes/add-http-https-port-to-init-e4924a20fb8cdc40.yaml new file mode 100644 index 00000000..6a7e52a0 --- /dev/null +++ b/releasenotes/notes/add-http-https-port-to-init-e4924a20fb8cdc40.yaml @@ -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. diff --git a/spec/classes/horizon_init_spec.rb b/spec/classes/horizon_init_spec.rb index 3350ab49..a275b377 100644 --- a/spec/classes/horizon_init_spec.rb +++ b/spec/classes/horizon_init_spec.rb @@ -273,7 +273,6 @@ describe 'horizon' do end end - context 'with ssl enabled' do before do params.merge!({ @@ -296,6 +295,22 @@ describe 'horizon' do 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 it 'configures apache' do is_expected.to contain_class('horizon::wsgi::apache').with({