From caf34e6ad6d7aeb338f2582bc4de539041aede8d Mon Sep 17 00:00:00 2001 From: djpbessems Date: Thu, 21 Apr 2022 08:52:54 +0200 Subject: [PATCH] Test delegate_to icw set_fact --- playbook.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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