Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions hooks/playbooks/skmo/configure-octavia-network.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
# Configure Octavia network infrastructure on master nodes
# This ensures br-octavia OVS bridges are UP for routing between
# worker pods and amphora instances.
- name: Configure Octavia network on master nodes
hosts: "{{ cifmw_target_host | default('localhost') }}"
gather_facts: false
tasks:
- name: Get master node names
environment:
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
PATH: "{{ cifmw_path }}"
ansible.builtin.command:
cmd: >-
oc get nodes
-l node-role.kubernetes.io/master
-o jsonpath='{.items[*].metadata.name}'
register: _master_nodes_result
changed_when: false

- name: Ensure br-octavia is UP on all master nodes
environment:
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
PATH: "{{ cifmw_path }}"
ansible.builtin.shell: |
set -xe -o pipefail
oc debug node/{{ item }} -- chroot /host ip link set br-octavia up
loop: "{{ _master_nodes_result.stdout.split() }}"
register: _br_octavia_result

- name: Verify br-octavia is UP on all master nodes
environment:
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
PATH: "{{ cifmw_path }}"
ansible.builtin.shell: |
set -xe -o pipefail
oc debug node/{{ item }} -- chroot /host ip link show br-octavia | grep -q "state UP"
loop: "{{ _master_nodes_result.stdout.split() }}"
changed_when: false
retries: 3
delay: 5
63 changes: 63 additions & 0 deletions hooks/playbooks/skmo/upload-octavia-amphora-images.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---
# Wait for Octavia amphora image upload to complete in both regions
# The octavia-operator automatically creates octavia-image-upload Jobs
# when amphoraImageContainerImage is set in the OSCP CR (via architecture).
# This playbook just waits for those uploads to complete before proceeding.
- name: Wait for Octavia amphora image upload in both regions
hosts: "{{ cifmw_target_host | default('localhost') }}"
gather_facts: false
vars:
cifmw_skmo_central_namespace: openstack
cifmw_skmo_leaf_namespace: openstack2
tasks:
- name: Wait for amphora image upload to complete in central region
kubernetes.core.k8s_info:
api_version: octavia.openstack.org/v1beta1
kind: Octavia
name: octavia
namespace: "{{ cifmw_skmo_central_namespace }}"
register: _octavia_central
until:
- _octavia_central.resources | length > 0
- _octavia_central.resources[0].status.conditions |
selectattr('type', 'equalto', 'OctaviaAmphoraImagesReady') |
selectattr('status', 'equalto', 'True') | list | length > 0
retries: 40
delay: 15

- name: Verify amphora image is active in central region
kubernetes.core.k8s_exec:
namespace: "{{ cifmw_skmo_central_namespace }}"
pod: openstackclient
command: >-
openstack image list --tag amphora-image -f value -c Status
register: _amphora_image_central_result
until: "'active' in _amphora_image_central_result.stdout"
retries: 60
delay: 30

- name: Wait for amphora image upload to complete in leaf region
kubernetes.core.k8s_info:
api_version: octavia.openstack.org/v1beta1
kind: Octavia
name: octavia
namespace: "{{ cifmw_skmo_leaf_namespace }}"
register: _octavia_leaf
until:
- _octavia_leaf.resources | length > 0
- _octavia_leaf.resources[0].status.conditions |
selectattr('type', 'equalto', 'OctaviaAmphoraImagesReady') |
selectattr('status', 'equalto', 'True') | list | length > 0
retries: 40
delay: 15

- name: Verify amphora image is active in leaf region
kubernetes.core.k8s_exec:
namespace: "{{ cifmw_skmo_leaf_namespace }}"
pod: openstackclient
command: >-
openstack image list --tag amphora-image -f value -c Status
register: _amphora_image_leaf_result
until: "'active' in _amphora_image_leaf_result.stdout"
retries: 60
delay: 30
Loading