mirror of
https://gitlab.sectorq.eu/jaydee/ansible.git
synced 2025-07-01 07:28:33 +02:00
init
This commit is contained in:
20
playbooks/72_register_k3s_worker.yml
Normal file
20
playbooks/72_register_k3s_worker.yml
Normal 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
|
Reference in New Issue
Block a user