-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathremove_vm.yml
More file actions
44 lines (37 loc) · 886 Bytes
/
Copy pathremove_vm.yml
File metadata and controls
44 lines (37 loc) · 886 Bytes
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
---
#
# This playbook removes a VM by name
#
- name: Remove VM
hosts: localhost
gather_facts: no
vars_prompt:
- name: vcenter_ip
prompt: vCenter IP or hostname
private: no
- name: vcenter_username
prompt: vCenter username
default: "{{ vcenter_username }}"
private: no
- name: vcenter_password
prompt: vCenter password
private: yes
- name: datacenter
prompt: VMWare datacenter
private: no
- name: vm_name
prompt: VM Name
private: no
tasks:
- name: "Remove VM"
community.vmware.vmware_guest:
hostname: "{{ vcenter_ip }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
validate_certs: False
name: "{{ vm_name }}"
force: true
state: absent
delegate_to: localhost
connection: local
register: vm_guest