`[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'`
IntermediateTroubleshootingCloud, AWX, Windows and Molecule
Answer
Likely causes → The aws_ec2 plugin only accepts files whose names end in aws_ec2.yml or aws_ec2.yaml. It can also fail if the collection is not installed, or if enable_plugins in ansible.cfg excludes auto and amazon.aws.aws_ec2.
Fix → Rename the file to inventory/prod.aws_ec2.yml:
plugin: amazon.aws.aws_ec2
regions: [ap-south-1]
filters:
instance-state-name: running
"tag:Env": prod
Test it with ansible-inventory -i inventory/prod.aws_ec2.yml --graph.
Prevent → Use the naming convention <env>.aws_ec2.yml, and check the inventory with ansible-inventory --graph in CI.
More on Cloud, AWX, Windows and Molecule
`Failed to import the required Python library (botocore and boto3) on web01's Python /usr/bin/python3.`BeginnerThe `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`winrm or requests is not installed: No module named 'winrm'`Beginner