From f2b4bfcd535e7286286b1cc281d3e96e1f2dfefa Mon Sep 17 00:00:00 2001 From: djpbessems Date: Mon, 18 Apr 2022 21:35:28 +0200 Subject: [PATCH] Renamed vars_file;Ensure idempotency w/ random string --- playbook.yml | 4 ++-- vars/{nodes.yml => cluster.k3s.yml} | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) rename vars/{nodes.yml => cluster.k3s.yml} (78%) diff --git a/playbook.yml b/playbook.yml index 42236d2..ee1eaca 100644 --- a/playbook.yml +++ b/playbook.yml @@ -2,7 +2,7 @@ gather_facts: false vars_files: - hypervisor.vcenter.yml - - nodes.yml + - cluster.k3s.yml tasks: - name: Clone multiple VMs from template community.vmware.vmware_guest: @@ -13,7 +13,7 @@ datacenter: "{{ hv.datacenter }}" folder: "{{ hv.folder }}" cluster: "{{ hv.cluster }}" - name: "{{ kubernetes.clustername | upper }}_{{ lookup('community.general.random_string', length=5, numbers=false, special=false) | upper }}" + name: "{{ kubernetes.clustername | upper }}_{{ community.general.random(seed=item.ip, length=5, numbers=false, special=false) | upper }}" guest_id: "{{ item.guest_id }}" hardware: memory_mb: 8192 diff --git a/vars/nodes.yml b/vars/cluster.k3s.yml similarity index 78% rename from vars/nodes.yml rename to vars/cluster.k3s.yml index 52764f9..294b7d1 100644 --- a/vars/nodes.yml +++ b/vars/cluster.k3s.yml @@ -2,12 +2,12 @@ kubernetes: clustername: k3s-dev servers: - - ip: 192.168.11.121 + - ip: 192.168.11.121/24 iso_path: ubuntu-20.04.1-live-server-amd64.iso guest_id: ubuntu64Guest - - ip: 192.168.11.122 + - ip: 192.168.11.122/24 iso_path: ubuntu-20.04.1-live-server-amd64.iso guest_id: ubuntu64Guest - - ip: 192.168.11.123 + - ip: 192.168.11.123/24 iso_path: ubuntu-20.04.1-live-server-amd64.iso guest_id: ubuntu64Guest