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
4 changes: 4 additions & 0 deletions roles/edpm_prepare/tasks/kustomize_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,7 @@
--namespace={{ cifmw_install_yamls_defaults['NAMESPACE'] }}
--for=condition=ready
--timeout={{ cifmw_edpm_prepare_timeout }}m
- name: Arnau - Intentionally fail
ansible.builtin.fail:
msg: "The pipeline has been stopped for debugging."
101 changes: 101 additions & 0 deletions roles/set_openstack_containers/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,15 @@
dest: "{{ cifmw_set_openstack_containers_basedir }}/artifacts/update_env_vars.sh"
mode: "0755"

- name: ARNAU get information PRE update
environment:
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
PATH: "{{ cifmw_path }}"
ansible.builtin.shell:
cmd: |
set -o pipefail
oc get pods -n openstack-operators > ~/openstack-pods-pre.out

- name: Run update_env_vars.sh script
cifmw.general.ci_script:
output_dir: "{{ cifmw_set_openstack_containers_basedir }}/artifacts"
Expand All @@ -87,6 +96,15 @@
- operator_name == 'openstack'
- not cifmw_architecture_scenario is defined

- name: ARNAU get information POST update
environment:
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
PATH: "{{ cifmw_path }}"
ansible.builtin.shell:
cmd: |
set -o pipefail
oc get pods -n openstack-operators > ~/openstack-pods-post.out

# Needed when the deployment wasn't installed using install_yaml.
- name: Wait for reinstallation of meta operator with arch scenario
environment:
Expand All @@ -107,6 +125,15 @@
- operator_name == 'openstack'
- cifmw_architecture_scenario is defined

- name: ARNAU get information post meta operator wait
environment:
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
PATH: "{{ cifmw_path }}"
ansible.builtin.shell:
cmd: |
set -o pipefail
oc get pods -n openstack-operators > ~/openstack-pods-post-wait.out

- name: Wait for reinstallation of operator
vars:
make_wait_env: "{{ cifmw_set_openstack_containers_common_env }}"
Expand All @@ -119,6 +146,80 @@
- operator_name != 'openstack'
- not cifmw_architecture_scenario is defined

- name: ARNAU get information PRE hardcoded sleep wait
environment:
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
PATH: "{{ cifmw_path }}"
ansible.builtin.shell:
cmd: |
set -o pipefail
oc get pods -n openstack-operators > ~/openstack-pods-pre-sleep.out

# Wait for 4 minutes so openstack-operator can be restarted in consecuence
# of reinstalating the meta operator
# It will get the current value of rabbitmq image and wait until it's updated
# with the value set by the update_env_vars.sh script
- name: Wait for openstack-operator to contain the new image values
environment:
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
PATH: "{{ cifmw_path }}"
ansible.builtin.shell:
cmd: |
set -o pipefail
oc get \
--namespace={{ operator_namespace }} \
$(oc get pod -l app.kubernetes.io/name=openstack-operator --no-headers=true -o name) \
-o json | \
jq -r '.spec.containers[].env[] | select(.name == "RELATED_IMAGE_RABBITMQ_IMAGE_URL_DEFAULT") | .value' | \
grep -q {{ cifmw_set_openstack_containers_tag }} \
register: rabbitmq_image
until: rabbitmq_image.rc == 0
retries: 24
delay: 10

- name: Wait for meta operator to became ready
environment:
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
PATH: "{{ cifmw_path }}"
ansible.builtin.shell:
cmd: |
set -o pipefail
oc wait --for=condition=Ready \
--namespace={{ operator_namespace }} \
--timeout=300s \
$(oc get pod -l app.kubernetes.io/name=openstack-operator --no-headers=true -o name)
when:
- operator_name == 'openstack'

- name: ARNAU get information POST hardcoded sleep wait
environment:
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
PATH: "{{ cifmw_path }}"
ansible.builtin.shell:
cmd: |
set -o pipefail
oc get pods -n openstack-operators > ~/openstack-pods-post-sleep.out

- name: ARNAU get information
environment:
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
PATH: "{{ cifmw_path }}"
ansible.builtin.shell:
cmd: |
set -o pipefail
oc describe $(oc get pod -l app.kubernetes.io/name=openstack-operator --no-headers=true -o name) > ~/openstack-controller.out
when:
- operator_name == 'openstack'

- name: ARNAU get information
environment:
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
PATH: "{{ cifmw_path }}"
ansible.builtin.shell:
cmd: |
set -o pipefail
oc get openstack openstack > ~/openstack-openstack.out

- name: Retrieve operator pods
environment:
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
Expand Down
Loading