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

pull/65739/head
Sandra McCann 5 years ago committed by Alicia Cozine
parent e82b28a920
commit 5eceebcaf3

@ -287,6 +287,29 @@ Use the following example as a guide for specifying roles in *requirements.yml*:
scm: git scm: git
version: "0.1" # quoted, so YAML doesn't parse this as a floating-point value 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 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 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. 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:: .. note::
While both roles and collections can be specified in one requirements file, they need to be installed separately. 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 The ``ansible-galaxy role install -r requirements.yml`` will only install roles and

Loading…
Cancel
Save