From 51a68ea0aec951f8dfef46f9c1c19aab5cbaeabd Mon Sep 17 00:00:00 2001 From: Kevin Fenzi Date: Thu, 28 May 2020 10:12:58 -0700 Subject: [PATCH] iad2: simplify proxy logic for multiple datacenters and make it one that works Signed-off-by: Kevin Fenzi --- roles/httpd/reverseproxy/templates/reversepassproxy.git.conf | 2 +- .../httpd/reverseproxy/templates/reversepassproxy.kojipkgs.conf | 2 +- roles/httpd/reverseproxy/templates/reversepassproxy.nagios.conf | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/httpd/reverseproxy/templates/reversepassproxy.git.conf b/roles/httpd/reverseproxy/templates/reversepassproxy.git.conf index bb27cdb5ad..d690eccc49 100644 --- a/roles/httpd/reverseproxy/templates/reversepassproxy.git.conf +++ b/roles/httpd/reverseproxy/templates/reversepassproxy.git.conf @@ -42,7 +42,7 @@ ProxyPreserveHost On Require valid-user -{% if 'phx2' in inventory_hostname or if 'iad2' in inventory_hostname %} +{% if datacenter == 'iad2' or datacenter == 'phx2' %} ProxyPass {{ localpath }} {{ proxyurl }}{{remotepath}} ProxyPassReverse {{ localpath }} {{ proxyurl }}{{remotepath}} {% else %} diff --git a/roles/httpd/reverseproxy/templates/reversepassproxy.kojipkgs.conf b/roles/httpd/reverseproxy/templates/reversepassproxy.kojipkgs.conf index 589f1fa981..3702893d79 100644 --- a/roles/httpd/reverseproxy/templates/reversepassproxy.kojipkgs.conf +++ b/roles/httpd/reverseproxy/templates/reversepassproxy.kojipkgs.conf @@ -31,7 +31,7 @@ ProxyPreserveHost On {% endif %} -{% if 'phx2' in inventory_hostname or if 'iad2' in inventory_hostname %} +{% if datacenter == 'iad2' or datacenter == 'phx2' %} {% if balancer_name is defined %} diff --git a/roles/httpd/reverseproxy/templates/reversepassproxy.nagios.conf b/roles/httpd/reverseproxy/templates/reversepassproxy.nagios.conf index 3f29cff144..bf19c1188c 100644 --- a/roles/httpd/reverseproxy/templates/reversepassproxy.nagios.conf +++ b/roles/httpd/reverseproxy/templates/reversepassproxy.nagios.conf @@ -1,4 +1,4 @@ -{% if 'phx2' in inventory_hostname or if 'iad2' in inventory_hostname %} +{% if datacenter == 'iad2' or datacenter == 'phx2' %} ProxyPass {{ localpath }} {{ proxyurl }}{{remotepath}} ProxyPassReverse {{ localpath }} {{ proxyurl }}{{remotepath}} {% else %}