cisagov / skeleton-ansible-role

A skeleton project for quickly getting a new cisagov Ansible role started.
Creative Commons Zero v1.0 Universal
7 stars 6 forks source link

`externally-managed-python.yml` playbook fails if `upgrade.yml` playbook updates Python #205

Closed jsf9k closed 4 months ago

jsf9k commented 4 months ago

🐛 Summary

For Debian 13 (Trixie/Testing) in this build the upgrade.yml playbook upgrades the python3 Debian package from Python 3.11 to Python 3.12. This then causes the externally-managed-python.yml playbook to fail with:

  PLAY [Ensure Python is marked as externally managed if appropriate] ************

  TASK [Gathering Facts] *********************************************************
  fatal: [debian13-systemd-amd64]: FAILED! => {"ansible_facts": {}, "changed": false, "failed_modules": {"ansible.legacy.setup": {"failed": true, "module_stderr": "/bin/sh: 1: /usr/bin/python3.11: not found\n", "module_stdout": "", "msg": "The module failed to execute correctly, you probably need to set the interpreter.\nSee stdout/stderr for the exact error", "rc": 127}}, "msg": "The following modules failed to execute: ansible.legacy.setup\n"}

To reproduce

Re-run the Debian 13 build linked above.

Expected behavior

I expected the externally-managed-python.yml playbook to succeed.

Any helpful log output or screenshots

See above.

mcdonnnj commented 4 months ago

Just some additional context on this for documentation. I believe this behavior is the result of the following sequence of events specific to Debian Testing (current Trixie):