1
0
mirror of https://github.com/openshift/installer.git synced 2026-02-05 06:46:36 +01:00
Files
installer/upi/openstack/down-compute-nodes.yaml
Michał Dulko c781171412 Remove support for Kuryr
In 4.15 Kuryr is no longer a supported NetworkType, following its
deprecation in 4.12. This commit removes mentions of Kuryr from the
documentation and code, but also adds validation to prevent
installations from being executed when `networkType` is set to `Kuryr`.
2023-11-14 15:06:19 +01:00

45 lines
1.5 KiB
YAML

# Required Python packages:
#
# ansible
# openstackclient
# openstacksdk
- ansible.builtin.import_playbook: common.yaml
- hosts: all
gather_facts: no
tasks:
- name: 'Remove the Compute servers'
openstack.cloud.server:
name: "{{ item.1 }}-{{ item.0 }}"
state: absent
with_indexed_items: "{{ [os_compute_server_name] * os_compute_nodes_number }}"
- name: 'List the Server groups'
ansible.builtin.command:
# os-compute-api-version 2.15 or higher is required for the 'soft-anti-affinity' policy
cmd: "openstack --os-compute-api-version=2.15 server group list -f json -c ID -c Name"
register: server_group_list
- name: 'Parse the Server group ID from existing'
ansible.builtin.set_fact:
server_group_id: "{{ (server_group_list.stdout | from_json | json_query(list_query) | first).ID }}"
vars:
list_query: "[?Name=='{{ os_compute_server_group_name }}']"
when:
- "os_compute_server_group_name|string in server_group_list.stdout"
- name: 'Remove the Compute server group'
ansible.builtin.command:
# os-compute-api-version 2.15 or higher is required for the 'soft-anti-affinity' policy
cmd: "openstack --os-compute-api-version=2.15 server group delete {{ server_group_id }}"
when:
- server_group_id is defined
- name: 'Remove the Compute ports'
openstack.cloud.port:
name: "{{ item.1 }}-{{ item.0 }}"
state: absent
with_indexed_items: "{{ [os_port_worker] * os_compute_nodes_number }}"