-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path99-cleanup.yaml
55 lines (51 loc) · 1.71 KB
/
99-cleanup.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
- name: unstretch pod
hosts: localhost
gather_facts: no
vars_files:
- vars.yaml
tasks:
- name: detach the volume from the hostgroup
delegate_to: localhost
purestorage.flasharray.purefa_hg:
hostgroup: "{{ hostgroup }}"
volume: "{{ pod_name }}::{{ vol_name }}"
state: absent
fa_url: "{{ item.fa_url }}"
api_token: "{{ item.api_token }}"
loop:
- { fa_url: "{{ fa_url1 }}", api_token: "{{ api_token1 }}" }
- { fa_url: "{{ fa_url2 }}", api_token: "{{ api_token2 }}" }
- name: delete the volume
delegate_to: localhost
purestorage.flasharray.purefa_volume:
name: "{{ pod_name }}::{{ vol_name }}"
eradicate: false
fa_url: "{{ fa_url1 }}"
api_token: "{{ api_token1 }}"
state: absent
- name: unstretch the pod
delegate_to: localhost
purestorage.flasharray.purefa_pod:
fa_url: "{{ fa_url1 }}"
api_token: "{{ api_token1 }}"
name: "{{ pod_name }}"
stretch: "{{ stretch_target }}"
state: absent
- name: delete and eradicate the pod
delegate_to: localhost
purestorage.flasharray.purefa_pod:
fa_url: "{{ fa_url1 }}"
api_token: "{{ api_token1 }}"
name: "{{ pod_name }}"
eradicate: true
state: absent
- name: delete the hostgroup
delegate_to: localhost
purestorage.flasharray.purefa_hg:
hostgroup: "{{ hostgroup }}"
state: absent
fa_url: "{{ item.fa_url }}"
api_token: "{{ item.api_token }}"
loop:
- { fa_url: "{{ fa_url1 }}", api_token: "{{ api_token1 }}" }
- { fa_url: "{{ fa_url2 }}", api_token: "{{ api_token2 }}" }