From 8cc89f85975de9d0b92100b9bf9614a882f15ab5 Mon Sep 17 00:00:00 2001
From: Jeremy Stanley <fungi@yuggoth.org>
Date: Wed, 19 Feb 2025 18:40:42 +0000
Subject: [PATCH] Add new Rackspace Flex projects

With the introduction of the DFW3 region, there are new projects
consistent across all regions. We want to switch to using those, but
right now our existing resources are in a legacy project that only
exists in the SJC3 region. Add the new projects to our bridge config
for both regions as new clouds, and remove the nonfunctional DFW3
from the old one for clarity. Once we've built up new resources and
cleaned up the old project in SJC3, we can clean up the entries
associated with it.

Change-Id: I66beaae4a6d53ad07293300153a2d4b8da33cc9f
---
 inventory/service/group_vars/bastion.yaml     | 24 +++++++++++++++++
 .../clouds/bridge_all_clouds.yaml.j2          | 26 ++++++++++++++++---
 .../group_vars/control-plane-clouds.yaml.j2   |  6 +++++
 3 files changed, 52 insertions(+), 4 deletions(-)

diff --git a/inventory/service/group_vars/bastion.yaml b/inventory/service/group_vars/bastion.yaml
index ee2e14c17e..b724a63fd1 100644
--- a/inventory/service/group_vars/bastion.yaml
+++ b/inventory/service/group_vars/bastion.yaml
@@ -238,6 +238,30 @@ cloud_launcher_clouds:
         network: PUBLICNET
         interfaces:
           - opendevzuul-subnet1
+  - name: opendevci-rax-flex-dfw3
+    oscc_cloud: opendevci-rax-flex
+    region_name: DFW3
+    profiles:
+      - openstackci-keypairs
+      - openstackci-security
+  - name: opendevci-rax-flex-sjc3
+    oscc_cloud: opendevci-rax-flex
+    region_name: SJC3
+    profiles:
+      - openstackci-keypairs
+      - openstackci-security
+  - name: opendevzuul-rax-flex-dfw3
+    oscc_cloud: opendevzuul-rax-flex
+    region_name: DFW3
+    profiles:
+      - openstackci-keypairs
+      - openstackci-security
+  - name: opendevzuul-rax-flex-sjc3
+    oscc_cloud: opendevzuul-rax-flex
+    region_name: SJC3
+    profiles:
+      - openstackci-keypairs
+      - openstackci-security
 
   # OSUOSL
   - name: opendevci-osuosl
diff --git a/playbooks/templates/clouds/bridge_all_clouds.yaml.j2 b/playbooks/templates/clouds/bridge_all_clouds.yaml.j2
index d55b81a60b..e827f3b763 100644
--- a/playbooks/templates/clouds/bridge_all_clouds.yaml.j2
+++ b/playbooks/templates/clouds/bridge_all_clouds.yaml.j2
@@ -73,9 +73,8 @@ clouds:
   opendevci-raxflex:
     regions:
       - name: SJC3
-      - name: DFW3
     auth:
-      auth_url: 'https://keystone.api.{region_name}.rackspacecloud.com/v3'
+      auth_url: 'https://keystone.api.sjc3.rackspacecloud.com/v3'
       project_id: '{{ clouds.opendevci_raxflex_project_id }}'
       username: '{{ clouds.opendevci_raxflex_username }}'
       password: '{{ clouds.opendevci_raxflex_key }}'
@@ -83,13 +82,32 @@ clouds:
   opendevzuul-raxflex:
     regions:
       - name: SJC3
-      - name: DFW3
     auth:
-      auth_url: 'https://keystone.api.{region_name}.rackspacecloud.com/v3'
+      auth_url: 'https://keystone.api.sjc3.rackspacecloud.com/v3'
       project_id: '{{ clouds.opendevzuul_raxflex_project_id }}'
       username: '{{ clouds.opendevzuul_raxflex_username }}'
       password: '{{ clouds.opendevzuul_raxflex_key }}'
       user_domain_name: rackspace_cloud_domain
+  opendevci-rax-flex:
+    regions:
+      - name: DFW3
+      - name: SJC3
+    auth:
+      auth_url: 'https://keystone.api.{region_name}.rackspacecloud.com/v3'
+      project_id: '{{ clouds.opendevci_rax_flex_project_id }}'
+      username: '{{ clouds.opendevci_rax_flex_username }}'
+      password: '{{ clouds.opendevci_rax_flex_key }}'
+      user_domain_name: rackspace_cloud_domain
+  opendevzuul-rax-flex:
+    regions:
+      - name: DFW3
+      - name: SJC3
+    auth:
+      auth_url: 'https://keystone.api.{region_name}.rackspacecloud.com/v3'
+      project_id: '{{ clouds.opendevzuul_rax_flex_project_id }}'
+      username: '{{ clouds.opendevzuul_rax_flex_username }}'
+      password: '{{ clouds.opendevzuul_rax_flex_key }}'
+      user_domain_name: rackspace_cloud_domain
   openstackjenkins-ovh:
     regions:
       - GRA1
diff --git a/playbooks/zuul/templates/group_vars/control-plane-clouds.yaml.j2 b/playbooks/zuul/templates/group_vars/control-plane-clouds.yaml.j2
index 6f41ea61c7..5a6d7b5eab 100644
--- a/playbooks/zuul/templates/group_vars/control-plane-clouds.yaml.j2
+++ b/playbooks/zuul/templates/group_vars/control-plane-clouds.yaml.j2
@@ -9,12 +9,18 @@ clouds:
   opendevci_raxflex_username: user
   opendevci_raxflex_key: apikey
   opendevci_raxflex_project_id: project
+  opendevci_rax_flex_username: user
+  opendevci_rax_flex_key: apikey
+  opendevci_rax_flex_project_id: project
   openstackjenkins_rax_username: user
   openstackjenkins_rax_key: apikey
   openstackjenkins_rax_project_id: project
   opendevzuul_raxflex_username: user
   opendevzuul_raxflex_key: apikey
   opendevzuul_raxflex_project_id: project
+  opendevzuul_rax_flex_username: user
+  opendevzuul_rax_flex_key: apikey
+  opendevzuul_rax_flex_project_id: project
   openstackjenkins_ovh_username: user
   openstackjenkins_ovh_password: password
   openstackjenkins_ovh_project_name: project