From e2b2e78eb8e2e273c4e48285de6ee27c06002491 Mon Sep 17 00:00:00 2001 From: djpbessems Date: Mon, 18 Apr 2022 15:47:06 +0200 Subject: [PATCH] Rebase to ISO;Add automatic name generation --- playbook.yml | 7 +++++-- vars/hypervisor.vcenter.yml | 1 + vars/nodes.yml | 8 +++++--- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/playbook.yml b/playbook.yml index 24d6e94..27ac581 100644 --- a/playbook.yml +++ b/playbook.yml @@ -13,8 +13,11 @@ datacenter: "{{ hv.datacenter }}" folder: "{{ hv.folder }}" cluster: "{{ hv.cluster }}" - name: "{{ item.ip }}" - template: "{{ item.template }}" + name: "{{ kubernetes.clustername }}_{{ lookup('community.general.random_string', length=5, upper=true, numbers=false, special=false) }}" + cdrom: + type: iso + iso_path: "[{{ hv.isodatastore }}] {{ item.iso_path }}" + # template: "{{ item.template }}" state: poweredon # customization_spec: "{{ customization_spec }}" delegate_to: localhost diff --git a/vars/hypervisor.vcenter.yml b/vars/hypervisor.vcenter.yml index 754a645..7e61cc8 100644 --- a/vars/hypervisor.vcenter.yml +++ b/vars/hypervisor.vcenter.yml @@ -6,4 +6,5 @@ hv: folder: Development cluster: Cluster.Legacy datastore: NAS01.RAID5 + isodatastore: ESX00.SSD03 network: LAN diff --git a/vars/nodes.yml b/vars/nodes.yml index 9fb8f67..9ab5b2a 100644 --- a/vars/nodes.yml +++ b/vars/nodes.yml @@ -1,8 +1,10 @@ --- +kubernetes: + clustername: k3s-dev servers: - ip: 192.168.11.121 - template: xyz + iso_path: ubuntu-20.04.1-live-server-amd64.iso - ip: 192.168.11.122 - template: abc + iso_path: ubuntu-20.04.1-live-server-amd64.iso - ip: 192.168.11.123 - template: pqr + iso_path: ubuntu-20.04.1-live-server-amd64.iso