forked from PabloPie/deploy-kubernetes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vm-destroy.yml
44 lines (40 loc) · 910 Bytes
/
vm-destroy.yml
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
- name: delete deployment
hosts: localhost
connection: local
gather_facts: false
vars_files:
- "vm_vars/credentials.yaml"
- "vm_vars/settings.yaml"
tasks:
- name: delete bastion
gandi_vps:
gandi_api_key: "{{ gandi_api_key }}"
instance_names: lb1
datacenter: "{{ datacenter }}"
state: deleted
tags: bastion
- name: delete all nodes
gandi_vps:
gandi_api_key: "{{ gandi_api_key }}"
name: "{{ item }}"
datacenter: "{{ datacenter }}"
state: deleted
with_items:
- master
- node0
- node1
- node2
- node3
tags: kube_cluster
async: 7200
poll: 0
register: node_deletion
- name: wait for deletion
async_status:
jid: "{{ item.ansible_job_id }}"
register: jobs
until: jobs.finished
delay: 10
retries: 300
with_items:
- "{{ node_deletion.results }}"