Skip to content

Commit 7b3b115

Browse files
committed
Fixed node passwords changing on reimage
1 parent 2861edb commit 7b3b115

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ansible/roles/k3s/files/start_k3s.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
k3s_server_name: "{{ os_metadata.meta.k3s_server }}"
77
service_name: "{{ 'k3s-agent' if k3s_server_name is defined else 'k3s' }}"
88
tasks:
9+
- name: Set agent node password as token # uses token to keep password consistent between reimages
10+
ansible.builtin.copy:
11+
dest: /etc/rancher/node/password
12+
content: "{{ k3s_token }}"
13+
914
- name: Add the token for joining the cluster to the environment
1015
no_log: true # avoid logging the server token
1116
ansible.builtin.lineinfile:

0 commit comments

Comments
 (0)