Skip to content

Commit

Permalink
Merge pull request #438 from jpodivin/testing-tripleo-cleanup
Browse files Browse the repository at this point in the history
Cleanup of tripleo services
  • Loading branch information
fao89 authored May 23, 2024
2 parents 399f496 + 752d2c9 commit f0361e9
Showing 1 changed file with 63 additions and 0 deletions.
63 changes: 63 additions & 0 deletions tests/roles/dataplane_adoption/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -560,3 +560,66 @@
- name: Adopted Neutron and OVN agents post-checks
ansible.builtin.include_tasks:
file: neutron_verify.yaml

- name: Remove leftover OOO services
block:
- name: Create OpenStackDataPlaneService/tripleo-cleanup
no_log: "{{ use_no_log }}"
ansible.builtin.shell: |
{{ shell_header }}
{{ oc_header }}
oc apply -f - <<EOF
apiVersion: dataplane.openstack.org/v1beta1
kind: OpenStackDataPlaneService
metadata:
name: tripleo-cleanup
spec:
playbook: osp.edpm.tripleo_cleanup
EOF
- name: Create OpenStackDataPlaneDeployment to run cleanup
no_log: "{{ use_no_log }}"
ansible.builtin.shell: |
{{ shell_header }}
{{ oc_header }}
oc apply -f - <<EOF
apiVersion: dataplane.openstack.org/v1beta1
kind: OpenStackDataPlaneDeployment
metadata:
name: tripleo-cleanup
spec:
nodeSets:
- openstack
servicesOverride:
- tripleo-cleanup
EOF
- name: Wait for the deployment to finish
ansible.builtin.shell: |
{{ shell_header }}
{{ oc_header }}
DEPLOYMENT_NAME=tripleo-cleanup
TRIES=180
DELAY=10
ALLOWED_JOB_RETRIES=1
for i in $(seq $TRIES)
do
ready=$(oc get osdpd/$DEPLOYMENT_NAME -o jsonpath='{.status.conditions[0].status}')
if [ "$ready" == "True" ]; then
echo "Pre adoption validation Deployment is Ready"
exit 0
else
failed=$(oc get jobs -l openstackdataplanedeployment=$DEPLOYMENT_NAME -o jsonpath="{.items[?(@.status.failed > $ALLOWED_JOB_RETRIES)].metadata.name}")
if [ ! -z "${failed}" ]; then
echo "There are failed AnsibleEE jobs: $failed"
exit 1
fi
fi
sleep $DELAY
done
echo "Run out of retries"
exit 2

0 comments on commit f0361e9

Please sign in to comment.