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

This commit is contained in:
Sandra McCann 2019-12-11 11:21:41 -05:00 committed by Alicia Cozine
parent e82b28a920
commit 5eceebcaf3
2 changed files with 37 additions and 0 deletions

View file

@ -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
---------------------------------------------

View file

@ -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