Installing Collections with a Requirements File
Categories:
An Ansible playbook project such as c2platform/rws/ansible-gis
typically contains a requirements file collections\requirements.yml
. The example content for this file is shown below:
---
collections:
- name: ansible.windows
version: 1.14.0
- name: community.windows
version: 1.13.0
- name: https://gitlab.com/c2platform/rws/ansible-collection-gis.git
type: git
version: 1.0.1
- name: https://gitlab.com/c2platform/rws/ansible-collection-wincore.git
type: git
version: master
Based on the given Ansible requirements file, Ansible will perform the following actions:
- Install the collection
ansible.windows
with version1.14.0
. - Install the collection
community.windows
with version1.13.0
. - Clone the Git repository
https://gitlab.com/c2platform/rws/ansible-collection-gis.git
and install the collection with version1.0.1
. - Clone the Git repository
https://gitlab.com/c2platform/rws/ansible-collection-wincore.git
and install the collection from themaster
branch.
Ansible will execute these actions when the command ansible-galaxy collection install -r collections/requirements.yml -p .
is run. The -r
flag specifies the requirements file to be used, and the -p
flag specifies the path where the collections will be installed (in this case, the current directory).
ansible-galaxy collection install -r collections/requirements.yml -p .
Moreover, this file can also be used by Ansible Automation Platform ( AAP ) or AWX. For more information see Installing collections — Ansible Documentation
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.