Interview Prep/Ansible/Privilege Escalation and Python Interpreter Issues

`fatal: [web01]: FAILED! => {"msg": "Could not find the requested service nginx: host"}`

BeginnerTroubleshootingPrivilege Escalation and Python Interpreter Issues
Answer

Likely causes → The service/unit does not exist (package not installed, or typo) or the init system is not detected (container without systemd).

Diagnose → systemctl list-unit-files | grep nginx; inside a container check PID 1.

Fix → Install the package first; use ansible.builtin.systemd explicitly. In containers use a systemd-enabled image or skip service tasks.

Prevent → Order tasks install → configure → service; test with Molecule on systemd images.

All Ansible questions Roadmap: Ansible

More on Privilege Escalation and Python Interpreter Issues