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

`molecule verify` fails with `ModuleNotFoundError: No module named 'testinfra'`

IntermediateTroubleshootingCloud, AWX, Windows and Molecule
Answer

Likely causes → The scenario sets verifier: name: testinfra, but pytest-testinfra is not installed. Since Molecule 3, the default verifier is Ansible (verify.yml), so old scenarios often still expect testinfra.

Fix → Run pip install pytest-testinfra, or move to the Ansible verifier:

verifier:
  name: ansible

with assertions in molecule/default/verify.yml (uri, command with changed_when: false, assert).

Prevent → Standardise one verifier across all roles, and pin its dependencies.

All Ansible questions Roadmap: Ansible

More on Cloud, AWX, Windows and Molecule