From d15b2fac7063fc91e62bcc3a4e4b61b0f14e925e Mon Sep 17 00:00:00 2001
From: Wolfgang Kulhanek <wkulhanek@users.noreply.github.com>
Date: Wed, 11 Mar 2020 01:19:52 +0100
Subject: [PATCH] Enable Infra Nodes (and Machine Autoscaling) for OpenStack (#1292)

---
 ansible/configs/ocp4-cluster/post_infra.yml |   75 +++++++++++++++++--------------------
 1 files changed, 34 insertions(+), 41 deletions(-)

diff --git a/ansible/configs/ocp4-cluster/post_infra.yml b/ansible/configs/ocp4-cluster/post_infra.yml
index 474289c..fd6bc10 100644
--- a/ansible/configs/ocp4-cluster/post_infra.yml
+++ b/ansible/configs/ocp4-cluster/post_infra.yml
@@ -5,51 +5,44 @@
   tags:
   - step002
   - post_infrastructure
-  environment:
-    OS_AUTH_URL: "{{ osp_auth_url }}"
-    OS_USERNAME: "{{ osp_auth_username }}"
-    OS_PASSWORD: "{{ osp_auth_password }}"
-    OS_PROJECT_NAME: "{{ osp_project_name }}"
-    OS_PROJECT_DOMAIN_ID: "{{ osp_auth_project_domain }}"
-    OS_USER_DOMAIN_NAME: "{{ osp_auth_user_domain }}"
   tasks:
-  - name: OpenShift Floating IPs on OpenStack
-    include_role:
-      name: ocp-infra-osp-fip
-    when: cloud_provider == 'osp'
+  - name: OpenStack Post Infrastructure
+    when: cloud_provider is match("osp")
+    environment:
+      OS_AUTH_URL: "{{ osp_auth_url }}"
+      OS_USERNAME: "{{ osp_auth_username }}"
+      OS_PASSWORD: "{{ osp_auth_password }}"
+      OS_PROJECT_NAME: "{{ osp_project_name }}"
+      OS_PROJECT_DOMAIN_ID: "{{ osp_auth_project_domain }}"
+      OS_USER_DOMAIN_NAME: "{{ osp_auth_user_domain }}"
+    block:
+    - name: OpenShift Floating IPs on OpenStack
+      include_role:
+        name: ocp-infra-osp-fip
 
-- name: Step 002.1
-  hosts: localhost
-  connection: local
-  become: false
-  tags:
-  - step002.1
-  - post_infrastructure
-  tasks:
-  - name: Set FQDN for the bastion VM
-    set_fact: 
-      rhel_remote_host: "{{item.fqdns|d(item.publicIps)|d('')}}"
-    with_items: "{{vm_list}}"
-    when:
-      - cloud_provider == 'azure'
-      - item.name == 'bastion'
-  - name: Set FQDN for each Windows VM
-    set_fact: 
-      windows_remote_hosts: ""
-  - name: Set FQDN for each Windows VM
-    set_fact: 
-      windows_remote_hosts: "{{item.fqdns|d(item.publicIps)|d('')}},{{windows_remote_hosts}}"
-    with_items: "{{vm_list}}"
-    when:
-      - cloud_provider == 'azure'
-      - item.name is match ('vmwin*')
-  - name: Print Host Information
-    debug:
-      msg: "{{ item }}"
-    with_items:
+  - name: Azure Post Infrastructure
+    when: cloud_provider is match("azure")
+    block:
+    - name: Set FQDN for the bastion VM
+      when: item.name is match('bastion')
+      set_fact: 
+        rhel_remote_host: "{{item.fqdns|d(item.publicIps)|d('')}}"
+      with_items: "{{vm_list}}"
+    - name: Set FQDN for each Windows VM
+      set_fact: 
+        windows_remote_hosts: ""
+    - name: Set FQDN for each Windows VM
+      when: item.name is match ('vmwin*')
+      set_fact: 
+        windows_remote_hosts: "{{item.fqdns|d(item.publicIps)|d('')}},{{windows_remote_hosts}}"
+      with_items: "{{vm_list}}"
+
+    - name: Print Host Information
+      debug:
+        msg: "{{ item }}"
+      with_items:
       - "user.info: Remote User: {{ remote_user }}"
       - "user.info: RHEL Bastion Host: {{ rhel_remote_host }}"
       - "user.info: Windows Host(s): {{ windows_remote_hosts }}"
       - "user.info: Windows Password: {{ windows_password }}"
-    when: cloud_provider == 'azure'
 

--
Gitblit v1.9.3