Test delegate_to icw set_fact
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
d1ff19b841
commit
caf34e6ad6
@ -137,7 +137,6 @@
|
|||||||
src: kube-vip.j2
|
src: kube-vip.j2
|
||||||
dest: /var/lib/rancher/k3s/server/manifests/kube-vip.yml
|
dest: /var/lib/rancher/k3s/server/manifests/kube-vip.yml
|
||||||
|
|
||||||
# when: inventory_hostname == ansible_play_hosts[0]
|
|
||||||
delegate_to: "{{ ansible_play_hosts[0] }}"
|
delegate_to: "{{ ansible_play_hosts[0] }}"
|
||||||
run_once: true
|
run_once: true
|
||||||
|
|
||||||
@ -157,3 +156,11 @@
|
|||||||
K3S_URL: "{{ 'https://' + ( cluster.virtualip | ansible.utils.ipaddr('address') ) + ':6443' }}"
|
K3S_URL: "{{ 'https://' + ( cluster.virtualip | ansible.utils.ipaddr('address') ) + ':6443' }}"
|
||||||
|
|
||||||
when: inventory_hostname != ansible_play_hosts[0]
|
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
|
||||||
|
Loading…
Reference in New Issue
Block a user