homeserver/roles/PyratLabs.k3s/tasks/pre_checks_cgroups.yml
mg 3cc377c1a7 Rolle aktualisiert: k3s (#455)
Co-authored-by: Michael Grote <michael.grote@posteo.de>
Reviewed-on: #455
2023-02-17 12:00:24 +01:00

17 lines
518 B
YAML

---
- name: Check if {{ cgroup.name }} cgroup is enabled
ansible.builtin.command:
cmd: 'grep -E "^{{ cgroup.name }}\s+.*\s+1$" /proc/cgroups'
failed_when: false
changed_when: false
check_mode: false
register: k3s_check_cgroup_option
- name: Fail if {{ cgroup.name }} cgroup is not enabled
ansible.builtin.assert:
that:
- k3s_check_cgroup_option.rc == 0
fail_msg: |
{{ cgroup.name }} cgroup disabled. {{ cgroup.documentation }}
success_msg: "{{ cgroup.name }} cgroup enabled."