Files
k3s-ansible/roles/k3s/node/tasks/prereq/Alpine.yml
Jiayi Hu d22ad01d50 Add Alpine Linux configuration
Signed-off-by: Jiayi Hu <jiayi.ghu@gmail.com>
2020-12-15 12:33:22 +01:00

31 lines
756 B
YAML

---
- name: Copy K3s service file
register: k3s_service
copy:
content: |
#!/sbin/openrc-run
name="k3s agent"
command="/usr/local/bin/k3s"
command_args="agent --server https://{{ master_ip }}:6443 --token {{ hostvars[groups['master'][0]]['token'] }} {{ extra_agent_args | default("") }}"
command_background=true
pidfile="/run/${RC_SVCNAME}.pid"
output_log="/var/log/k3s.log"
error_log="/var/log/k3s.err"
dest: /etc/init.d/k3s
owner: root
group: root
mode: 0755
- name: Create K3s service symlink
file:
src: /etc/init.d/k3s
dest: /etc/runlevels/default/k3s
state: link
- name: Enable and check K3s service
service:
name: k3s
state: restarted
enabled: yes