I am new to Ansible and looking to use some collections in my playbook (other than the built in ones). The issue I have is that if i run a playbook to show what collections are available, the list is a very small subset of all of the collections that appear to be available on my control plane.
If I ssh to my control plane as the user i am running ansible as ‘ansible’ and execute the command
‘’’
ansible-galaxy collection list
‘’’
then i get a full list of collections.
If I run the playbook below against the control plane as the user ‘ansible’ I only see about 12 collections
‘’’
- name: List All Installed Collections
hosts: localhost
remote_user: ansible
gather_facts: false
tasks:-
name: Use ansible-galaxy to list collections
command: ansible-galaxy collection list
register: galaxy_output -
name: Display installed collections
debug:
var: galaxy_output.stdout_lines
‘’’
-
If I check the ansible config on the host with
‘’’
ansible-config list
‘’’
I can see that the COLLECTIONS_PATHS default is as I’d expect and if i check those locations i see all collections.
I’m running ansible v2.10.8
Whatever i do i can’t get my playbook to see all collections. Am I fundamentally misunderstanding how this should work?