mirror of
https://github.com/PyratLabs/ansible-role-k3s.git
synced 2024-11-29 12:55:51 +01:00
Add cgroup checks
This commit is contained in:
parent
a3c4d9cfae
commit
e5c69ec894
15
tasks/validate/environment/remote/cgroups.yml
Normal file
15
tasks/validate/environment/remote/cgroups.yml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
- name: Check if {{ cgroup.name }} cgroup is enabled
|
||||||
|
ansible.builtin.command: grep -E "^{{ cgroup.name }}\s+.*\s+1$" /proc/cgroups
|
||||||
|
failed_when: false
|
||||||
|
changed_when: 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."
|
@ -13,12 +13,20 @@
|
|||||||
- not k3s_skip_validation
|
- not k3s_skip_validation
|
||||||
- not k3s_skip_env_checks
|
- not k3s_skip_env_checks
|
||||||
|
|
||||||
|
- include_tasks: environment/remote/cgroups.yml
|
||||||
|
loop: "{{ k3s_cgroup_subsys }}"
|
||||||
|
loop_control:
|
||||||
|
loop_var: cgroup
|
||||||
|
when:
|
||||||
|
- not k3s_skip_validation
|
||||||
|
- not k3s_skip_env_checks
|
||||||
|
|
||||||
- include_tasks: environment/remote/packages.yml
|
- include_tasks: environment/remote/packages.yml
|
||||||
loop: "{{ k3s_check_packages }}"
|
loop: "{{ k3s_check_packages }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: package
|
loop_var: package
|
||||||
when:
|
when:
|
||||||
- k3s_skip_validation
|
- not k3s_skip_validation
|
||||||
- not k3s_skip_env_checks
|
- not k3s_skip_env_checks
|
||||||
|
|
||||||
- include_tasks: environment/local/issue-data.yml
|
- include_tasks: environment/local/issue-data.yml
|
||||||
|
@ -143,3 +143,13 @@ k3s_deprecated_config:
|
|||||||
- setting: docker
|
- setting: docker
|
||||||
correction: "docker: false"
|
correction: "docker: false"
|
||||||
when: 1.20.0
|
when: 1.20.0
|
||||||
|
|
||||||
|
k3s_cgroup_subsys:
|
||||||
|
- name: memory
|
||||||
|
documentation: |
|
||||||
|
If you are running on a Raspberry Pi, see:
|
||||||
|
https://rancher.com/docs/k3s/latest/en/advanced/#enabling-cgroups-for-raspbian-buster
|
||||||
|
- name: cpuset
|
||||||
|
documentation: |
|
||||||
|
If you are running Alpine Linux, see:
|
||||||
|
https://rancher.com/docs/k3s/latest/en/advanced/#additional-preparation-for-alpine-linux-setup
|
||||||
|
Loading…
Reference in New Issue
Block a user