-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathcreate_vm.yml
More file actions
28 lines (27 loc) · 942 Bytes
/
create_vm.yml
File metadata and controls
28 lines (27 loc) · 942 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
---
- name: create vm from a template
hosts: localhost
become: false
gather_facts: false
tasks:
- name: create VM
community.vmware.vmware_guest:
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
validate_certs: "{{ vcenter_validate_certs }}"
datacenter: "{{ vcenter_datacenter }}"
cluster: "{{ vcenter_cluster }}"
template: "{{ vm_template }}"
name: "{{ vm_name }}"
folder: "{{ vcenter_destination_folder }}"
state: "{{ vm_state }}"
- name: Set the state of a virtual machine to poweroff
vmware.vmware.vm_powerstate:
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
datacenter: "{{ vcenter_datacenter }}"
validate_certs: false
name: "{{ vm_name }}"
state: powered-on