I have the following module in my ansible playbook that I wish to run using awx:
- name: Clean up and Prune everything docker on oasis
community.docker.docker_prune:
containers: true
images: true
networks: true
volumes: true
builder_cache: true
When running this playbook I get the following error:
ERROR! couldn't resolve module/action 'community.docker.docker_prune'. This often indicates a misspelling, missing collection, or incorrect module path.
The error appears to be in '/runner/project/update_machines.yml': line 38, column 7, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
- name: Clean up and Prune everything docker on oasis
^ here
How do I fix it? I can run this using command line ansible with no issues on a different VM with ansible installed.
Found 2 ways to do it.
ansible_buildfor it). Look here for more infocollections/requirements.ymlin your project folder. So I created acollectionsfolder at the root ofansible project directoryand then created arequirements.ymlinside this folder. Add your required modules in this file. for example mine looks like this:More info here.