From e3fb3c27f24db4f8822c160482c2bf5163c3b69d Mon Sep 17 00:00:00 2001
From: Clark Boylan <clark.boylan@gmail.com>
Date: Tue, 12 Mar 2019 14:34:37 -0700
Subject: [PATCH] Allow optional status_uri to be set for status backups

This updates the status_backups resource definition to allow for
specific uris to be set. This allows you to do per tenant backups
without tenant white labeling in the web server.

Change-Id: Ia94a16ef8b2a1069b9265bae2773cd323ac9a188
---
 manifests/status_backups.pp | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/manifests/status_backups.pp b/manifests/status_backups.pp
index 4437d31..53c5027 100644
--- a/manifests/status_backups.pp
+++ b/manifests/status_backups.pp
@@ -15,13 +15,20 @@
 define zuul::status_backups (
   $tenant_name,
   $ssl,
+  $status_uri = undef,
 ) {
-  if $tenant_name and $tenant_name != '' {
+  if $status_uri == undef {
     if $ssl {
       $status = "https://${name}/api/status"
     } else {
       $status = "http://${name}/api/status"
     }
+  }
+  else {
+    $status = $status_uri
+  }
+
+  if $tenant_name and $tenant_name != '' {
     # Minutes, hours, days, etc are not specified here because we are
     # interested in running this *every minute*.
     # This is a mean of backing up status.json periodically in order to provide