Skip to content

Commit 19da5d5

Browse files
committed
k3s agent no longer uses task vars
1 parent bd71974 commit 19da5d5

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

ansible/extras.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
tags: k3s
1313
tasks:
1414
- name: Start k3s agents
15-
vars: # set outside of role to allow compute init to define own value
16-
k3s_bootstrap_token: "{{ hostvars[groups['k3s_server'] | first]._k3s_token_output.stdout | default('') }}"
1715
ansible.builtin.include_role:
1816
name: k3s
1917
tasks_from: agent-runtime.yml

ansible/roles/k3s/tasks/server-runtime.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,7 @@
2828
shell:
2929
cmd: "k3s token create --ttl {{ k3s_bootstrap_token_expiry }}"
3030
register: _k3s_token_output
31+
32+
- name: Set bootstrap token as fact
33+
set_fact:
34+
k3s_bootstrap_token: "{{ _k3s_token_output.stdout }}"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
k3s_bootstrap_token: "{{ hostvars[groups['k3s_server'] | first].k3s_bootstrap_token | default('') }}"

0 commit comments

Comments
 (0)