Refactor random vm name;Add subnet key
Some checks reported errors
continuous-integration/drone/push Build encountered an error

This commit is contained in:
Danny Bessems 2022-04-18 22:03:10 +02:00
parent f2b4bfcd53
commit d2dcc237d9

View File

@ -13,7 +13,7 @@
datacenter: "{{ hv.datacenter }}"
folder: "{{ hv.folder }}"
cluster: "{{ hv.cluster }}"
name: "{{ kubernetes.clustername | upper }}_{{ community.general.random(seed=item.ip, length=5, numbers=false, special=false) | upper }}"
name: "{{ kubernetes.clustername | upper }}_{{ (item.ip | checksum | regex_replace('[0-9]', ''))[0..5] | upper }}"
guest_id: "{{ item.guest_id }}"
hardware:
memory_mb: 8192
@ -24,7 +24,8 @@
datastore: "{{ hv.datastore }}"
networks:
- name: "{{ hv.network }}"
ip: "{{ item.ip }}"
ip: "{{ item.ip | ansible.netcommon.ipaddr('address') }}"
netmask: "{{ item.ip | ansible.netcommon.ipaddr('netmask') }}"
cdrom:
- type: iso
iso_path: "[{{ hv.isodatastore }}] {{ item.iso_path }}"