From 965f2b33b85f32e92ff52b88cea3fbc25e8dd5d9 Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Sun, 18 Oct 2020 15:09:45 +0200 Subject: [PATCH] Set reverse proxy servername via certs The certs class already has the correct servername (set via init.pp) so this avoids a mismatch. It also adds aliases via the CNAME, which is new functionality. --- manifests/init.pp | 1 - manifests/reverse_proxy.pp | 6 ++---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 29da2b3c..5e1b2864 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -219,7 +219,6 @@ ~> class { 'foreman_proxy_content::reverse_proxy': path => '/', url => "${foreman_url}/", - servername => $foreman_proxy_fqdn, port => $reverse_proxy_port, subscribe => Class['certs::foreman_proxy'], ssl_protocol => $ssl_protocol, diff --git a/manifests/reverse_proxy.pp b/manifests/reverse_proxy.pp index 95b49a68..17978cda 100644 --- a/manifests/reverse_proxy.pp +++ b/manifests/reverse_proxy.pp @@ -4,8 +4,6 @@ # The path where to mount the reverse proxy # @param url # The URL to forward to -# @param servername -# The Apache vhost server name to listen on # @param port # The port to listen on # @param ssl_protocol @@ -17,7 +15,6 @@ class foreman_proxy_content::reverse_proxy ( Stdlib::Unixpath $path = '/', Stdlib::Httpurl $url = "${foreman_proxy_content::foreman_url}/", - Stdlib::Fqdn $servername = $foreman_proxy_content::foreman_proxy_fqdn, Stdlib::Port $port = $foreman_proxy_content::reverse_proxy_port, Variant[Array[String], String, Undef] $ssl_protocol = undef, Hash[String, Any] $vhost_params = {}, @@ -30,7 +27,8 @@ Class['certs', 'certs::ca', 'certs::apache', 'certs::foreman_proxy'] ~> Class['apache::service'] apache::vhost { 'katello-reverse-proxy': - servername => $servername, + servername => $certs::apache::hostname, + aliases => $certs::apache::cname, port => $port, docroot => '/var/www/', priority => '28',