Interview Prep/Ansible/Cloud, AWX, Windows and Molecule

Molecule passes locally but fails in GitHub Actions at `Gathering Facts` with `/bin/sh: 1: python3: not found`

AdvancedTroubleshootingCloud, AWX, Windows and Molecule
Answer

Likely causes → The CI scenario uses a bare official image (ubuntu:24.04, debian:12) with no Python. Locally, a cached test image with Python was used.

Fix → Use an image that has Python and systemd (pre_build_image: true), or bootstrap in prepare.yml before facts are gathered:

- hosts: all
  gather_facts: false
  tasks:
    - ansible.builtin.raw: test -e /usr/bin/python3 || (apt-get update && apt-get install -y python3)
      changed_when: false

Prevent → Pin test images by tag or digest in molecule.yml, and run CI and local tests with the same images.

All Ansible questions Roadmap: Ansible

More on Cloud, AWX, Windows and Molecule