2021-04-03 21:42:44 +02:00
|
|
|
---
|
|
|
|
|
|
|
|
- name: Check if {{ cgroup.name }} cgroup is enabled
|
2021-04-10 13:15:51 +02:00
|
|
|
ansible.builtin.command:
|
|
|
|
cmd: 'grep -E "^{{ cgroup.name }}\s+.*\s+1$" /proc/cgroups'
|
2021-04-03 21:42:44 +02:00
|
|
|
failed_when: false
|
|
|
|
changed_when: false
|
2021-04-18 21:39:06 +02:00
|
|
|
check_mode: false
|
2021-04-03 21:42:44 +02:00
|
|
|
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."
|