Clarify how to install roles and collections from same requirements file (#65707) (#65736)

(cherry picked from commit 5eceebcaf3)
pull/65759/head
Sandra McCann 5 years ago committed by Alicia Cozine
parent 58a62da92d
commit 6ba26e7556

@ -287,6 +287,29 @@ Use the following example as a guide for specifying roles in *requirements.yml*:
scm: git
version: "0.1" # quoted, so YAML doesn't parse this as a floating-point value
Installing roles and collections from the same requirements.yml file
---------------------------------------------------------------------
You can install roles and collections from the same requirements files, with some caveats.
.. code-block:: yaml
---
roles:
# Install a role from Ansible Galaxy.
- src: geerlingguy.java
version: 1.9.6
collections:
# Install a collection from Ansible Galaxy.
- name: geerlingguy.php_roles
version: 0.9.3
source: https://galaxy.ansible.com
.. note::
While both roles and collections can be specified in one requirements file, they need to be installed separately.
The ``ansible-galaxy role install -r requirements.yml`` will only install roles and ``ansible-galaxy collection install -r requirements.yml -p ./`` will only install collections.
Installing multiple roles from multiple files
---------------------------------------------

@ -18,6 +18,20 @@ The ``version`` key can take in the same range identifier format documented abov
Roles can also be specified and placed under the ``roles`` key. The values follow the same format as a requirements
file used in older Ansible releases.
.. code-block:: yaml
---
roles:
# Install a role from Ansible Galaxy.
- src: geerlingguy.java
version: 1.9.6
collections:
# Install a collection from Ansible Galaxy.
- name: geerlingguy.php_roles
version: 0.9.3
source: https://galaxy.ansible.com
.. note::
While both roles and collections can be specified in one requirements file, they need to be installed separately.
The ``ansible-galaxy role install -r requirements.yml`` will only install roles and

Loading…
Cancel
Save