I’m attempting to run the integration tests for the ec2_vpc_nacl
moudule of the amazon.aws
collection and I’m running into an issue where the community.general
collection is not installed in the container.
The command I’m running is:
ansible-test integration ec2_vpc_nacl --docker
(I’ve also tried using different container images such as fedora40
).
The integration tests always fail because one of the tasks is attempting to use the community.general.json_query
module, but the community.general
collection isn’t being installed in the container by ansible-test
.
TASK [ec2_vpc_nacl : Set helpful facts about subnets] **************************
fatal: [testhost]: FAILED! => {"msg": "template error while templating string: Could not load \"community.general.json_query\": 'Invalid plugin FQCN (community.general.json_query): unable to locate collection community.general'. String: {{ subnets | community.general.json_query('results[*].subnet.id') }}. Could not load \"community.general.json_query\": 'Invalid plugin FQCN (community.general.json_query): unable to locate collection community.general'"}
(NOTE: To get to the above task the fix from PR 2429 needs to be applied or use the --start-at-task "Fetch AZ availability"
)
I found that the community.general
collection wasn’t added to the integration/tests/requirements.yml
file so I added it locally to the file:
---
collections:
- ansible.windows
- ansible.utils # ipv6 filter
- amazon.cloud # used by integration tests - rds_cluster_modify
- community.general # used by integration test - ec2_vpc_nacl
However, even after adding the collection to the requirements.yml
it is not found when running the test.
What do I need to do to get the collection installed in the container to be used during testing?