2022-04-18 10:58:57 +00:00
|
|
|
- hosts: localhost
|
|
|
|
gather_facts: false
|
|
|
|
vars_files:
|
2022-04-18 12:28:05 +00:00
|
|
|
- hypervisor.vcenter.yml
|
|
|
|
- nodes.yml
|
2022-04-18 10:58:57 +00:00
|
|
|
tasks:
|
|
|
|
- name: Clone multiple VMs from template
|
2022-04-18 12:28:05 +00:00
|
|
|
community.vmware.vmware_guest:
|
|
|
|
hostname: "{{ hv.hostname }}"
|
|
|
|
username: "{{ hv.username }}"
|
|
|
|
password: "{{ hv_password }}"
|
2022-04-18 10:58:57 +00:00
|
|
|
validate_certs: no
|
2022-04-18 12:28:05 +00:00
|
|
|
datacenter: "{{ hv.datacenter }}"
|
|
|
|
folder: "{{ hv.folder }}"
|
|
|
|
cluster: "{{ hv.cluster }}"
|
2022-04-18 13:53:21 +00:00
|
|
|
name: "{{ kubernetes.clustername }}_{{ lookup('community.general.random_string', length=5, numbers=false, special=false) }}"
|
2022-04-18 13:56:31 +00:00
|
|
|
guest_id: "{{ item.guest_id }}"
|
2022-04-18 13:53:21 +00:00
|
|
|
disk:
|
|
|
|
- size_gb: 50
|
|
|
|
type: thin
|
|
|
|
datastore: "{{ hv.datastore }}"
|
2022-04-18 13:47:06 +00:00
|
|
|
cdrom:
|
|
|
|
type: iso
|
|
|
|
iso_path: "[{{ hv.isodatastore }}] {{ item.iso_path }}"
|
|
|
|
# template: "{{ item.template }}"
|
2022-04-18 10:58:57 +00:00
|
|
|
state: poweredon
|
2022-04-18 12:28:05 +00:00
|
|
|
# customization_spec: "{{ customization_spec }}"
|
|
|
|
delegate_to: localhost
|
2022-04-18 10:58:57 +00:00
|
|
|
with_items: "{{ servers }}"
|