forked from openshift/installer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
down-compute-nodes.yaml
37 lines (31 loc) · 1023 Bytes
/
down-compute-nodes.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Required Python packages:
#
# ansible
# openstackclient
# openstacksdk
- import_playbook: common.yaml
- hosts: all
gather_facts: no
tasks:
- name: 'Remove the Compute servers'
os_server:
name: "{{ item.1 }}-{{ item.0 }}"
state: absent
with_indexed_items: "{{ [os_compute_server_name] * os_compute_nodes_number }}"
- name: 'List the Compute trunks'
command:
cmd: "openstack network trunk list -c Name -f value"
when: os_networking_type == "Kuryr"
register: trunks
- name: 'Remove the Compute trunks'
command:
cmd: "openstack network trunk delete {{ item.1 }}-{{ item.0 }}"
when:
- os_networking_type == "Kuryr"
- (item.1|string + '-' + item.0|string) in trunks.stdout_lines|list
with_indexed_items: "{{ [os_compute_trunk_name] * os_compute_nodes_number }}"
- name: 'Remove the Compute ports'
os_port:
name: "{{ item.1 }}-{{ item.0 }}"
state: absent
with_indexed_items: "{{ [os_port_worker] * os_compute_nodes_number }}"