-
Notifications
You must be signed in to change notification settings - Fork 0
/
VM_Create_Student01.yml
41 lines (40 loc) · 1.09 KB
/
VM_Create_Student01.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
---
- hosts: localhost
gather_facts: false
connection: local
tasks:
- name: create the VM
vmware_guest:
hostname: '{{ vsphere_host }}'
username: '{{ vsphere_user }}'
password: '{{ vsphere_password }}'
validate_certs: false
esxi_hostname: '{{ esxi_hostname }}'
datacenter: '{{ vsphere_datacenter }}'
folder: '{{ vsphere_folder }}'
name: '{{ inventory_hostname }}'
state: poweredon
guest_id: '{{ guest_id }}'
disk:
- size_gb: 40
type: thin
datastore: '{{ vsphere_datastore }}'
networks:
- name: '{{ guest_network }}'
ip: '{{ guest_custom_ip }}'
netmask: 255.255.255.0
gateway: 49.254.105.1
dns_servers:
- 8.8.8.8
- 168.126.63.1
hardware:
memory_mb: '{{ guest_memory }}'
num_cpus: '{{ guest_vcpu }}'
customization:
dns_servers:
- 8.8.8.8
- 168.126.63.1
domain : vsphere.local
hostname: '{{ inventory_hostname }}'
template: '{{ guest_template }}'
wait_for_ip_address: yes