Files
1d16ef3334 user: warn when seuser is set on systems without SELinux (#86671)
When the seuser parameter is provided but SELinux is not enabled on the
target system, the parameter is silently ignored and the module reports
changed: true. This misleads users into thinking SELinux user mappings
were applied.

Emit a warning when seuser is set and SELinux is not enabled, so users
are aware the parameter has no effect. This uses module.selinux_enabled()
to check at runtime rather than checking the platform type, as recommended by the maintainers.

The warning alone is not enough — useradd still receives the -Z flag
and fails with "useradd: -Z requires SELinux enabled kernel". Skip
adding -Z to the command when SELinux is not enabled.


Fixes #85542


---------

Co-authored-by: olegnazarov23 <olegnazarov23@users.noreply.github.com>
2026-03-18 08:30:40 -07:00
..
2025-05-16 08:25:18 -07:00
2024-11-25 16:43:40 -08:00