This commit is contained in:
jaydee
2022-12-14 02:23:34 +01:00
parent fdcd79983a
commit 7385b59c72
43 changed files with 1729 additions and 0 deletions

View File

@ -0,0 +1,20 @@
- hosts: odroid_worker
name: Another task
become: true
tasks:
- name: Print token
ansible.builtin.debug:
msg: "[Master] K3S_TOKEN_HOLDER K3S token is {{ hostvars['K3S_TOKEN_HOLDER']['token'] }}"
- name: Print token
ansible.builtin.debug:
msg: "{{ hostvars['K3S_TOKEN_HOLDER']['token'] }}"
- name: Reconfigure K3S Worker
ansible.builtin.lineinfile:
path: /etc/systemd/system/k3s-agent.service.env
regexp: '^K3S_TOKEN='
line: K3S_TOKEN=\'{{ hostvars['K3S_TOKEN_HOLDER']['token'] }}\'
changed_when: false
- name: Restart K3S Worker
ansible.builtin.service:
name: k3s-agent
state: restarted