From f997876fd326a06aef6a443a90017c3ba845f4d7 Mon Sep 17 00:00:00 2001 From: djpbessems Date: Wed, 20 Apr 2022 12:42:01 +0200 Subject: [PATCH] Fix autovar reference --- playbook.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/playbook.yml b/playbook.yml index 2b1a443..5e2b104 100644 --- a/playbook.yml +++ b/playbook.yml @@ -103,19 +103,19 @@ - name: Install K3s binary (initial node) ansible.builtin.shell: cmd: "curl -sfL https://get.k3s.io | sh -s - server --cluster-init --disable local-storage,traefik --tls-san {{ cluster.virtualip | ansible.utils.ipaddr('address') }}" - when: inventory_hostname == k3s_ha[0] + when: inventory_hostname == ansible_play_hosts[0] - name: Retrieve token (from initial node) ansible.builtin.slurp: src: /var/lib/rancher/k3s/server/token register: k3s_token run_once: true - delegate_to: k3s_ha[0] + delegate_to: ansible_play_hosts[0] - name: Install K3s binary (additional nodes) ansible.builtin.shell: - cmd: "curl -sfL https://get.k3s.io | sh -s - server --cluster-init --disable local-storage,traefik --tls-san {{ cluster.virtualip | ansible.utils.ipaddr('address') }}" + cmd: "curl -sfL https://get.k3s.io | sh -s - server --disable local-storage,traefik" environment: K3S_TOKEN: "{{ k3s_token.content | b64decode | trim }}" K3S_URL: "{{ 'https://' + ( cluster.virtualip | ansible.utils.ipaddr('address') ) + ':6443' }}" - when: inventory_hostname != k3s_ha[0] + when: inventory_hostname != ansible_play_hosts[0]