Ansible.K3sCluster/playbook.yml
djpbessems a8bdc59d7a
All checks were successful
continuous-integration/drone/push Build is passing
Replace deprecated collection;Add cdrom controller/unit id's
2022-04-18 22:26:52 +02:00

38 lines
1.2 KiB
YAML

- hosts: localhost
gather_facts: false
vars_files:
- hypervisor.vcenter.yml
- cluster.k3s.yml
tasks:
- name: Clone multiple VMs from template
community.vmware.vmware_guest:
hostname: "{{ hv.hostname }}"
username: "{{ hv.username }}"
password: "{{ hv_password }}"
validate_certs: no
datacenter: "{{ hv.datacenter }}"
folder: "{{ hv.folder }}"
cluster: "{{ hv.cluster }}"
name: "{{ kubernetes.clustername | upper }}_{{ (item.ip | checksum | regex_replace('[0-9]', ''))[:5] | upper }}"
guest_id: "{{ item.guest_id }}"
hardware:
memory_mb: 8192
num_cpus: 4
disk:
- size_gb: 50
type: thin
datastore: "{{ hv.datastore }}"
networks:
- name: "{{ hv.network }}"
ip: "{{ item.ip | ansible.utils.ipaddr('address') }}"
netmask: "{{ item.ip | ansible.utils.ipaddr('netmask') }}"
cdrom:
- type: iso
iso_path: "[{{ hv.isodatastore }}] {{ item.iso_path }}"
controller_number: 0
unit_number: 0
state: poweredon
# customization_spec: "{{ customization_spec }}"
delegate_to: localhost
with_items: "{{ servers }}"