1
0
mirror of https://github.com/openshift/installer.git synced 2026-02-05 15:47:14 +01:00
Files
installer/upi/openstack/down-containers.yaml
Roman Dobosz 7ec4cdfb39 Make swift containers removal not fatal for UPI.
When there is OpenStack deployment, which doesn't have swift services,
or there are no containers used at all, listing them will fail the
playbook and leave exit code other than 0, which may interrupt CI.

With this commit, errors from listing containers will be ignored, which
will cover both cases.
2025-05-20 14:05:11 +02:00

23 lines
621 B
YAML

# Required Python packages:
#
# ansible
# openstackclient
# openstacksdk
- ansible.builtin.import_playbook: common.yaml
- hosts: all
gather_facts: no
tasks:
- name: 'List the containers associated with the cluster'
ansible.builtin.command:
cmd: "openstack container list --prefix {{ os_infra_id }} -f value -c Name"
register: container_list
ignore_errors: true
- name: 'Delete the containers associated with the cluster'
ansible.builtin.command:
cmd: "openstack container delete -r {{ container_list.stdout }}"
when: container_list.rc == 0 and container_list.stdout|length > 0