`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.
More on Cloud, AWX, Windows and Molecule
`Failed to import the required Python library (botocore and boto3) on web01's Python /usr/bin/python3.`Beginner`[WARNING]: * Failed to parse inventory/aws.yml with auto plugin: inventory source 'inventory/aws.yml' could not be verified by inventory plugin 'amazon.aws.aws_ec2'`IntermediateThe `aws_ec2` inventory parses without errors but returns zero hostsIntermediate`Failed to describe instances: An error occurred (UnauthorizedOperation) when calling the DescribeInstances operation` or `(ExpiredToken)`IntermediateDynamic inventory finds the instances, but every host is `UNREACHABLE`IntermediateUsing the SSM connection plugin fails with `SessionManagerPlugin is not found` or hangs on file transferAdvanced