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
|
2022-04-18 19:35:28 +00:00
|
|
|
- cluster.k3s.yml
|
2022-04-18 10:58:57 +00:00
|
|
|
tasks:
|
2022-04-18 20:49:50 +00:00
|
|
|
- name: Deploy VMs from OVF-template
|
|
|
|
# community.vmware.vmware_guest:
|
|
|
|
community.vmware.vmware_deploy_ovf:
|
2022-04-18 12:28:05 +00:00
|
|
|
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 20:49:50 +00:00
|
|
|
name: "{{ kubernetes.clustername | upper }}_{{ (item.ip | checksum)[-5:] | upper }}"
|
|
|
|
datastore: "{{ hv.datastore }}"
|
2022-04-18 21:08:48 +00:00
|
|
|
disk_provisioning: thin
|
|
|
|
networks:
|
|
|
|
"LAN": "{{ hv.network }}"
|
2022-04-18 20:49:50 +00:00
|
|
|
power_on: yes
|
2022-04-18 21:08:48 +00:00
|
|
|
ovf: "https://{{ repo_username }}:{{ repo_password }}@sn.itch.fyi/Repository/rel/Ubuntu-Server-20.04.ova"
|
|
|
|
deployment_option: "{{ image.deployment_option }}"
|
|
|
|
properties:
|
|
|
|
guestinfo.hostname: "{{ kubernetes.clustername | upper }}_{{ (item.ip | checksum)[-5:] | upper }}"
|
|
|
|
guestinfo.rootpw: "{{ root_password }}"
|
|
|
|
guestinfo.rootsshkey: "foo"
|
|
|
|
guestinfo.ntpserver: 127.0.0.1
|
2022-04-18 21:12:30 +00:00
|
|
|
guestinfo.ipaddress: "{{ item.ip | ansible.utils.ipaddr('address') }}"
|
|
|
|
guestinfo.prefixlength: "{{ (item.ip | split('/'))[-1] }}"
|
2022-04-18 21:08:48 +00:00
|
|
|
guestinfo.dnsserver: 127.0.0.1
|
|
|
|
guestinfo.gateway: 127.0.0.1
|
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 }}"
|