What is content collection?

Content Collections are a way to package and distribute Ansible content, making it easier to share and reuse automated content.

Bash
ansible-galaxy collection install community.general -p /etc/ansible/collection

Bash
Starting galaxy collection install process
Process install dependency map
Starting collection install process
Downloading https://galaxy.ansible.com/api/v3/plugin/ansible/content/published/collections/artifacts/community-general-7.5.0.tar.gz to /root/.ansible/tmp/ansible-local-32029rn14n3e4/tmpqcc43sof/community-general-7.5.0-tg0ru1lf
Installing 'community.general:7.5.0' to '/etc/ansible/collection/ansible_collections/community/general'
community.general:7.5.0 was installed successfully

Bash
# /home/ansible_ctrl/.ansible/collections/ansible_collections
Collection         Version
------------------ -------
community.general  7.4.0

Bash
ansible-galaxy collection list

Adding collections_paths to ansible.cfg

Bash
# vim ansible.cfg and add the following
collections_path = home/ansible_ctrl/.ansible/collections/ansible_collections:/etc/ansible/collection

Leave a Comment

Your email address will not be published. Required fields are marked *