ansible-collections/ansible.posix

ansible.posix.cgroup_perf_recap callback doesnt work with cgroup v2 and needs documentation update

ju2wheels opened this issue · 0 comments

SUMMARY

Currently cgroup_perf_recap only supports cgroup v1 which has been phased out. Ubuntu 22.04 for example, ships with only the unified cgroup mount (v2) and doesnt by default support cgroup v1 anymore making this profiling callback unusable.

The other problem is the minimal documentation on cgroup setup makes the assumption that you are manually creating a one off non persisted cgroup (unless you use startup scripts to recreate it on boot) manually using cgroup CLI management commands rather than the more likely use of systemd slices to manage and create the cgroup. It also makes no mention that the callback requires write permissions to the cgroupfs which has ramifications to implementation as cgroups created with systemd slices which by default only give cgroupfs write access to the root user. If you use a systemd slice to manage the cgroup but dont run the Ansible controller as root by default, then your only option is to use systemd Delegate option which then means you cannot use cgroup v1 at all (see systemd cgroup implementation details ).

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

cgroup_perf_recap

ADDITIONAL INFORMATION

It would be nice if this supported cgroup v2, the documentation was clearer with requirements provided a systemd slice example, and if it was at least made aware of or made configurable support for the various cgroup mounting styles (legacy, hybrid, unified) described in documentation linked above.