diff --git a/manifests/wsgi/apache.pp b/manifests/wsgi/apache.pp index 67b34dfa..f9e8424d 100644 --- a/manifests/wsgi/apache.pp +++ b/manifests/wsgi/apache.pp @@ -27,6 +27,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) +# # [*horizon_cert*] # (required with listen_ssl) Certificate to use for SSL support. # @@ -75,6 +81,8 @@ class horizon::wsgi::apache ( $servername = $::fqdn, $server_aliases = $::fqdn, $listen_ssl = false, + $http_port = 80, + $https_port = 443, $ssl_redirect = true, $horizon_cert = undef, $horizon_key = undef, @@ -188,7 +196,7 @@ class horizon::wsgi::apache ( alias => "${$::horizon::params::root_url}/static", path => '/usr/share/openstack-dashboard/static', }], - port => 80, + port => $http_port, ssl_cert => $horizon_cert, ssl_key => $horizon_key, ssl_ca => $horizon_ca, @@ -224,7 +232,7 @@ class horizon::wsgi::apache ( error_log_file => 'horizon_ssl_error.log', priority => $priority, ssl => true, - port => 443, + port => $https_port, ensure => $ensure_ssl_vhost, wsgi_daemon_process => 'horizon-ssl', wsgi_process_group => 'horizon-ssl', diff --git a/spec/classes/horizon_wsgi_apache_spec.rb b/spec/classes/horizon_wsgi_apache_spec.rb index 10de3941..a0d70066 100644 --- a/spec/classes/horizon_wsgi_apache_spec.rb +++ b/spec/classes/horizon_wsgi_apache_spec.rb @@ -43,6 +43,7 @@ describe 'horizon::wsgi::apache' do 'serveraliases' => ['*'], 'docroot' => '/var/www/', 'ssl' => 'false', + 'port' => '80', 'redirectmatch_status' => 'permanent', 'redirectmatch_regexp' => '^/$', 'redirectmatch_dest' => platforms_params[:root_url], @@ -77,6 +78,7 @@ describe 'horizon::wsgi::apache' do 'serveraliases' => ['*'], 'docroot' => '/var/www/', 'ssl' => 'false', + 'port' => '80', 'redirectmatch_status' => 'temp', 'redirectmatch_regexp' => '^/$', 'redirectmatch_dest' => platforms_params[:root_url], @@ -111,6 +113,7 @@ describe 'horizon::wsgi::apache' do 'serveraliases' => ['*'], 'docroot' => '/var/www/', 'ssl' => 'true', + 'port' => '443', 'ssl_cert' => '/etc/pki/tls/certs/httpd.crt', 'ssl_key' => '/etc/pki/tls/private/httpd.key', 'ssl_ca' => '/etc/pki/tls/certs/ca.crt', @@ -130,6 +133,7 @@ describe 'horizon::wsgi::apache' do 'serveraliases' => ['*'], 'docroot' => '/var/www/', 'ssl' => 'false', + 'port' => '80', 'redirectmatch_status' => 'permanent', 'redirectmatch_regexp' => '(.*)', 'redirectmatch_dest' => 'https://some.host.tld',