-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathundeploy.yml
executable file
·119 lines (115 loc) · 3.61 KB
/
undeploy.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
##
## Project: VMware NSXT SDDC Design POC Lab
## Authors: VirtualSachIN
## Filename: undeploy.yml
##
---
- hosts: localhost
gather_facts: False
connection: local
vars_files:
- answerfile.yml
name: undeploy.yml
tasks:
- name: Remove Physical ESXi Host to vCSA for SDDC Lab deployment
community.vmware.vmware_host:
hostname: "{{ Nested_vCenter.FQDN | lower }}"
username: "{{ Nested_vCenter.User }}"
password: "{{ Nested_vCenter.Password }}"
datacenter_name: "{{ Nested_vCenter.DataCenter }}"
cluster_name: "{{ Target.Physical_Cluster }}"
validate_certs: false
esxi_hostname: "{{ Target.FQDN }}"
esxi_username: "{{ Target.User }}"
esxi_password: "{{ Target.Password }}"
state: absent
async: 7200
poll: 0
- name: Remove ESXi VMs for Cluster-A
community.vmware.vmware_guest:
hostname: "{{ Target.FQDN }}"
username: "{{ Target.User }}"
password: "{{ Target.Password }}"
validate_certs: no
name: "{{ item.value.VMName }}"
force: true
state: absent
async: 7200
poll: 0
loop: "{{ Nested_ESXi.HostCA | dict2items }}"
ignore_errors: true
- name: Remove ESXi VMs for Cluster-B
community.vmware.vmware_guest:
hostname: "{{ Target.FQDN }}"
username: "{{ Target.User }}"
password: "{{ Target.Password }}"
validate_certs: no
name: "{{ item.value.VMName }}"
force: true
state: absent
async: 7200
poll: 0
loop: "{{ Nested_ESXi.HostCB | dict2items }}"
ignore_errors: true
- name: Remove vCenter VM
community.vmware.vmware_guest:
hostname: "{{ Target.FQDN }}"
username: "{{ Target.User }}"
password: "{{ Target.Password }}"
validate_certs: no
name: "{{ Nested_vCenter.VMName }}"
force: true
state: absent
ignore_errors: true
- name: Remove NSX Manager VM(s)
community.vmware.vmware_guest:
hostname: "{{ Target.FQDN }}"
username: "{{ Target.User }}"
password: "{{ Target.Password }}"
validate_certs: no
name: "{{ Nested_NSXT.Components.LocalManager.VMName }}"
force: true
state: absent
ignore_errors: true
- name: Remove NSX EDGE VM-1
community.vmware.vmware_guest:
hostname: "{{ Target.FQDN }}"
username: "{{ Target.User }}"
password: "{{ Target.Password }}"
validate_certs: no
name: vSDDC-T0-EdgeVM-01
force: true
state: absent
ignore_errors: true
- name: Remove NSX EDGE VM-2
community.vmware.vmware_guest:
hostname: "{{ Target.FQDN }}"
username: "{{ Target.User }}"
password: "{{ Target.Password }}"
validate_certs: no
name: vSDDC-T0-EdgeVM-02
force: true
state: absent
ignore_errors: true
- name: Remove NSXT EDGE VM(s)
community.vmware.vmware_guest:
hostname: "{{ Target.FQDN }}"
username: "{{ Target.User }}"
password: "{{ Target.Password }}"
validate_certs: no
name: "{{ item.value.Name }}"
force: true
state: absent
ignore_errors: true
with_dict: "{{ AVI.Cluster }}"
- name: Remove AVI VM(s)
community.vmware.vmware_guest:
hostname: "{{ Target.FQDN }}"
username: "{{ Target.User }}"
password: "{{ Target.Password }}"
validate_certs: no
name: "{{ item.value.Name }}"
force: true
state: absent
ignore_errors: true
with_dict: "{{ AVI.Cluster }}"