Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions ansible/roles/k3s/tasks/server-runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@
delay: 10
until: not _k3s_connected_nodes.failed

- name: Generate new bootstrap token if not all agents are connected
no_log: true
when: _k3s_connected_nodes.stdout_lines | length != groups['k3s'] | length
shell:
cmd: "k3s token create --ttl {{ k3s_bootstrap_token_expiry }}"
register: _k3s_token_output
- when: _k3s_connected_nodes.stdout_lines | length != groups['k3s'] | length
block:
- name: Generate new bootstrap token if not all agents are connected
no_log: true
shell:
cmd: "k3s token create --ttl {{ k3s_bootstrap_token_expiry }}"
register: _k3s_token_output

- name: Set bootstrap token as fact
set_fact:
k3s_bootstrap_token: "{{ _k3s_token_output.stdout }}"
- name: Set bootstrap token as fact
set_fact:
k3s_bootstrap_token: "{{ _k3s_token_output.stdout }}"