forked from rbales79/Ansible-Swarm-Deploy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vm-create-multiple.yml
40 lines (40 loc) · 1.14 KB
/
vm-create-multiple.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
---
- name: Clone multiple VMs
hosts: localhost
gather_facts: false
vars_files:
test_vms.yml
tasks:
- name: Clone multiple VMs from template
local_action:
module: vmware_guest
hostname: "{{ vcenter_hostname }}"
username: "{{ username }}"
password: "{{ password }}"
validate_certs: False
folder: "{{ folder }}"
template: "{{ vmtemplate }}"
datastore: "{{ datastore }}"
name: "{{ item }}"
cluster: "{{ vmcluster }}"
datacenter: "{{ datacenter }}"
networks:
- name: "{{ networks }}"
disk:
- size_gb: "{{ disk_size | default(20) }}"
type: thin
hardware:
memory_mb: "{{ memory | default(8196) }}"
num_cpus: "{{ cpus | default(2) }}"
scsi: paravirtual
customization:
dns_servers:
- '{{ guest_dns_server }}'
domain : '{{ guest_domain_name }}'
#hostname: '{{ inventory_hostname }}'
linked_clone: "{{ linked_clone }}"
snapshot_src: "{{ snapshot_name }}"
state: poweredon
wait_for_ip_address: True
with_items: "{{ servers }}"
delegate_to: localhost