26 lines
624 B
YAML
26 lines
624 B
YAML
---
|
|
- name: Download and install K3s agent
|
|
ansible.builtin.shell:
|
|
cmd: >
|
|
curl -sfL https://get.k3s.io |
|
|
INSTALL_K3S_VERSION={{ k3s_version }}
|
|
K3S_URL={{ k3s_server_url }}
|
|
K3S_TOKEN={{ k3s_node_token }}
|
|
sh -
|
|
creates: /usr/local/bin/k3s
|
|
|
|
- name: Ensure K3s agent service is running
|
|
ansible.builtin.service:
|
|
name: k3s-agent
|
|
state: started
|
|
enabled: true
|
|
become: true
|
|
|
|
- name: Label node as storage
|
|
ansible.builtin.shell:
|
|
cmd: >
|
|
k3s kubectl label node nik-debian
|
|
node-role=storage --overwrite
|
|
delegate_to: minisforum
|
|
become: true
|
|
changed_when: false |