Interview Prep/Ansible/Privilege Escalation and Python Interpreter Issues

`fatal: [web01]: FAILED! => {"msg": "Aborting, target uses selinux but python bindings (libselinux-python) aren't installed!"}`

IntermediateTroubleshootingPrivilege Escalation and Python Interpreter Issues
Answer

Likely causes → SELinux is enabled and the Python SELinux bindings are not available to the interpreter in use.

Diagnose → getenforce, rpm -q python3-libselinux.

Fix →

ansible web01 -b -m ansible.builtin.dnf -a "name=python3-libselinux state=present"

Use the system interpreter (not a venv).

Prevent → Include python3-libselinux in the base image.

All Ansible questions Roadmap: Ansible

More on Privilege Escalation and Python Interpreter Issues