ansible-role-k3s/tasks/operate/start-k3s.yml
Xan Manning 2c12436226 Bugfixes
- Added uninstall task to remove hard-linked files #88
  - Fixed missing become for `systemd` operations tasks. #89
  - Added `k3s_start_on_boot` to control `systemd.enabled`.
2021-01-30 17:23:31 +00:00

18 lines
569 B
YAML

---
- name: Ensure k3s service is started
ansible.builtin.systemd:
name: k3s
state: started
enabled: "{{ k3s_start_on_boot }}"
when: k3s_non_root is not defined or not k3s_non_root
become: "{{ k3s_become_for_systemd | ternary(true, false, k3s_become_for_all) }}"
- name: Ensure k3s service is started
ansible.builtin.systemd:
name: k3s
state: started
enabled: "{{ k3s_start_on_boot }}"
scope: user
when: k3s_non_root is defined and k3s_non_root
become: "{{ k3s_become_for_systemd | ternary(true, false, k3s_become_for_all) }}"