diff --git a/manifests/wsgi/apache.pp b/manifests/wsgi/apache.pp index 267a74ce..2c92fc5e 100644 --- a/manifests/wsgi/apache.pp +++ b/manifests/wsgi/apache.pp @@ -66,6 +66,9 @@ # apache::vhost ssl parameters. # Optional. Default to apache::vhost 'ssl_*' defaults. # +# [*vhost_custom_fragment*] +# (optional) Additional vhost configuration, if applicable. +# # == Dependencies # # requires Class['apache'] & Class['heat'] @@ -78,20 +81,21 @@ # define heat::wsgi::apache ( $port, - $servername = $::fqdn, - $bind_host = undef, - $path = '/', - $ssl = true, - $workers = 1, - $ssl_cert = undef, - $ssl_key = undef, - $ssl_chain = undef, - $ssl_ca = undef, - $ssl_crl_path = undef, - $ssl_crl = undef, - $ssl_certs_dir = undef, - $threads = $::os_workers, - $priority = '10', + $servername = $::fqdn, + $bind_host = undef, + $path = '/', + $ssl = true, + $workers = 1, + $ssl_cert = undef, + $ssl_key = undef, + $ssl_chain = undef, + $ssl_ca = undef, + $ssl_crl_path = undef, + $ssl_crl = undef, + $ssl_certs_dir = undef, + $threads = $::os_workers, + $priority = '10', + $vhost_custom_fragment = undef, ) { if $title !~ /^api(|_cfn|_cloudwatch)$/ { fail('The valid options are api, api_cfn, api_cloudwatch') @@ -129,5 +133,6 @@ define heat::wsgi::apache ( wsgi_script_source => getvar("::heat::params::heat_${title}_wsgi_script_source"), allow_encoded_slashes => 'on', require => Anchor['heat::install::end'], + vhost_custom_fragment => $vhost_custom_fragment, } } diff --git a/manifests/wsgi/apache_api_cfn.pp b/manifests/wsgi/apache_api_cfn.pp index 1cba07fe..8be184d1 100644 --- a/manifests/wsgi/apache_api_cfn.pp +++ b/manifests/wsgi/apache_api_cfn.pp @@ -89,6 +89,10 @@ class heat::wsgi::apache_api_cfn ( $priority = '10', ) { + # See custom fragment below + include ::apache + include ::apache::mod::headers + validate_integer($port) # Workaround for https://bugzilla.redhat.com/show_bug.cgi?id=1396553 @@ -99,21 +103,24 @@ class heat::wsgi::apache_api_cfn ( notify => Heat::Wsgi::Apache['api_cfn'], } } + heat::wsgi::apache { 'api_cfn': - port => $port, - servername => $servername, - bind_host => $bind_host, - path => $path, - ssl => $ssl, - workers => $workers, - ssl_cert => $ssl_cert, - ssl_key => $ssl_key, - ssl_chain => $ssl_chain, - ssl_ca => $ssl_ca, - ssl_crl_path => $ssl_crl_path, - ssl_crl => $ssl_crl, - ssl_certs_dir => $ssl_certs_dir, - threads => $threads, - priority => $priority, + port => $port, + servername => $servername, + bind_host => $bind_host, + path => $path, + ssl => $ssl, + workers => $workers, + ssl_cert => $ssl_cert, + ssl_key => $ssl_key, + ssl_chain => $ssl_chain, + ssl_ca => $ssl_ca, + ssl_crl_path => $ssl_crl_path, + ssl_crl => $ssl_crl, + ssl_certs_dir => $ssl_certs_dir, + threads => $threads, + priority => $priority, + # Enforce content-type, see https://bugs.launchpad.net/tripleo/+bug/1641589 + vhost_custom_fragment => 'RequestHeader set Content-Type "application/json"', } }