diff --git a/playbook.yml b/playbook.yml index e469511..47904d6 100644 --- a/playbook.yml +++ b/playbook.yml @@ -17,7 +17,7 @@ datacenter: "{{ hv.datacenter }}" folder: "{{ hv.folder }}" cluster: "{{ hv.cluster }}" - name: "{{ kubernetes.clustername | upper }}_{{ (item.ip | checksum)[-5:] | upper }}" + name: "{{ kubernetes.clustername | upper }}-{{ (item.ip | checksum)[-5:] | upper }}" datastore: "{{ hv.datastore }}" disk_provisioning: thin networks: @@ -26,14 +26,14 @@ ovf: /scratch/image.ova deployment_option: "{{ image.deployment_option }}" properties: - guestinfo.hostname: "{{ kubernetes.clustername | upper }}_{{ (item.ip | checksum)[-5:] | upper }}" + guestinfo.hostname: "{{ kubernetes.clustername | upper }}-{{ (item.ip | checksum)[-5:] | upper }}" guestinfo.rootpw: "{{ root_password }}" guestinfo.rootsshkey: "foo" - guestinfo.ntpserver: 127.0.0.1 + guestinfo.ntpserver: "{{ network.ntpserver }}" guestinfo.ipaddress: "{{ item.ip | ansible.utils.ipaddr('address') }}" - guestinfo.prefixlength: "{{ (item.ip | split('/'))[-1] }}" - guestinfo.dnsserver: 127.0.0.1 - guestinfo.gateway: 127.0.0.1 + guestinfo.prefixlength: "{{ (item.ip | ansible.utils.ipaddr('prefix') }}" + guestinfo.dnsserver: "{{ network.dnsserver }}" + guestinfo.gateway: "{{ network.gateway }}" # customization_spec: "{{ customization_spec }}" delegate_to: localhost with_items: "{{ servers }}" diff --git a/vars/cluster.k3s.yml b/vars/cluster.k3s.yml index 444d1b1..ce7bd5a 100644 --- a/vars/cluster.k3s.yml +++ b/vars/cluster.k3s.yml @@ -4,6 +4,10 @@ kubernetes: image: deployment_option: large ova_url: sn.itch.fyi/Repository/rel/Ubuntu-Server-20.04.ova +network: + ntpserver: 0.pool.ntp.org,1.pool.ntp.org,2.pool.ntp.org + dnsserver: 192.168.11.220,192.168.5.220 + gateway: 192.168.11.1 servers: - ip: 192.168.11.121/24 guest_id: ubuntu64Guest