mirror of
https://gitlab.sectorq.eu/jaydee/ansible.git
synced 2025-06-30 23:28:32 +02:00
21 lines
695 B
YAML
21 lines
695 B
YAML
- 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
|