This commit is contained in:
parent
4e4623909e
commit
44e6a160af
16
playbook.yml
16
playbook.yml
@ -108,9 +108,19 @@
|
|||||||
K3S_TOKEN: "{{ cluster.mastertoken | default('', true) }}"
|
K3S_TOKEN: "{{ cluster.mastertoken | default('', true) }}"
|
||||||
K3S_URL: "{{ cluster.apiurl | default('', true) }}"
|
K3S_URL: "{{ cluster.apiurl | default('', true) }}"
|
||||||
|
|
||||||
- name: Retrieve token & reference new cluster
|
- name: Reference new cluster
|
||||||
ansible.builtin.set_fact:
|
block:
|
||||||
cluster: "{{ cluster | combine( { 'mastertoken': \"{{ lookup('file', '/var/lib/rancher/k3s/server/token') }}\" }, { 'apiurl': \"https://{{ cluster.virtualip | ansible.utils.ipaddr('address') }}:6443\" } ) }}"
|
|
||||||
|
- name: Retrieve token
|
||||||
|
ansible.builtin.slurp:
|
||||||
|
src: /var/lib/rancher/k3s/server/token
|
||||||
|
register: k3s_token
|
||||||
|
|
||||||
|
- ansible.builtin.debug:
|
||||||
|
var: k3s_token
|
||||||
|
|
||||||
|
- name: Add to dictionary
|
||||||
|
cluster: "{{ cluster | combine( { 'mastertoken': k3s_token }, { 'apiurl': \"https://{{ cluster.virtualip | ansible.utils.ipaddr('address') }}:6443\" } ) }}"
|
||||||
when: cluster.mastertoken is not defined
|
when: cluster.mastertoken is not defined
|
||||||
|
|
||||||
- ansible.builtin.debug:
|
- ansible.builtin.debug:
|
||||||
|
Loading…
Reference in New Issue
Block a user