Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup of tripleo services #438

Merged
Merged
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
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
lewisdenny marked this conversation as resolved.
Show resolved Hide resolved
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
Comment on lines +572 to +577
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should have it in the dataplane-operator repo

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have priory art defining adoption specific service on the fly in the data-plane-adoption repo. The pre-adoption-validation service is defined in the same way.

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
Loading