Duplicate collection debian 12

Hello,

I am new to ansible, and I have a question with collection.
Currently my OS is debian 12, I installed ansible from ansible repositories, so I have full up-to-date version :

root@admin:/home/user# ansible --version
ansible [core 2.14.16]
  config file = None
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.11.2 (main, Aug 26 2024, 07:20:54) [GCC 12.2.0] (/usr/bin/python3)
  jinja version = 3.1.2
  libyaml = True

I want to install the community.vmware collection following ansible documentation with the following command :

ansible-galaxy collection install community.vmware

This will deploy the collection into : /root/.ansible/collections/ansible_collections

But by running ansible-galaxy collection list I can see that I have duplicate ansible collections :

root@admin:/home/user# ansible-galaxy collection list  | grep vmware
community.vmware 5.0.1  
vmware.vmware    1.5.0  
community.vmware                         4.7.1  
vmware.vmware                            1.5.0  
vmware.vmware_rest                       3.2.0

So I don’t know which version will be used in my code. For information older version of vmware is installed into /usr/lib/python3/dist-packages/ansible_collections folder, I assume this is shipped with ansible-core.

What is th good solution here ? (delete old collections manually ? )

Thank you

The first one found is the one used, be aware that playbooks can have an ‘adjacent’ collection directory that has higher precedence. Newer versions of Ansible (2.14 is pretty old, 2.18 is about to be released) will do a better job of displaying locations. In any case, adding -vvv will show the location at which each collection is found.

1 Like

What do you mean by “installed from ansible repositories”? It looks more like you installed ansible from the normal Debian repo.

As @bcoca mentioned, 2.14 is pretty old and not up-to-date. Debian is known to often ship pretty old versions. This is by design, though, because they don’t want to introduce new versions with (potentially) new bugs and problems.

ansible-core shouldn’t include this collection, but ansible should.

BTW community.vmware doesn’t support ansible-core 2.14 since 4.0.0 (that is, the collection release).

1 Like