diff --git a/playbook.yml b/playbook.yml index df70874..31b44b4 100644 --- a/playbook.yml +++ b/playbook.yml @@ -137,7 +137,6 @@ src: kube-vip.j2 dest: /var/lib/rancher/k3s/server/manifests/kube-vip.yml - # when: inventory_hostname == ansible_play_hosts[0] delegate_to: "{{ ansible_play_hosts[0] }}" run_once: true @@ -157,3 +156,11 @@ K3S_URL: "{{ 'https://' + ( cluster.virtualip | ansible.utils.ipaddr('address') ) + ':6443' }}" when: inventory_hostname != ansible_play_hosts[0] + + - ansible.builtin.debug: + var: cluster + - ansible.builtin.set_fact: + cluster: "{{ cluster | combine( { 'token': ( k3s_token.content | b64decode | trim ) } ) }}" + delegate_to: "{{ ansible_play_hosts[0] }}" + - ansible.builtin.debug: + var: cluster