ansible-role-k3s/tasks/operate/stop-k3s.yml
Xan Manning 7e4a16e167 Pre-documentation work
- Restructured when and asserts
  - Standardise molecule call, add systemd config
2021-02-16 16:53:49 +00:00

21 lines
577 B
YAML

---
- name: Ensure k3s service is stopped
ansible.builtin.systemd:
name: k3s
state: stopped
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: stopped
enabled: "{{ k3s_start_on_boot }}"
scope: user
when:
- k3s_non_root is defined
- k3s_non_root
become: "{{ k3s_become_for_systemd | ternary(true, false, k3s_become_for_all) }}"