From 5eceebcaf3328aafa8d0bcd9d3f280460217104f Mon Sep 17 00:00:00 2001 From: Sandra McCann Date: Wed, 11 Dec 2019 11:21:41 -0500 Subject: [PATCH] Clarify how to install roles and collections from same requirements file (#65707) --- docs/docsite/rst/galaxy/user_guide.rst | 23 +++++++++++++++++++ .../installing_multiple_collections.txt | 14 +++++++++++ 2 files changed, 37 insertions(+) diff --git a/docs/docsite/rst/galaxy/user_guide.rst b/docs/docsite/rst/galaxy/user_guide.rst index de0230769e2..8ded40660a6 100644 --- a/docs/docsite/rst/galaxy/user_guide.rst +++ b/docs/docsite/rst/galaxy/user_guide.rst @@ -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 --------------------------------------------- diff --git a/docs/docsite/rst/shared_snippets/installing_multiple_collections.txt b/docs/docsite/rst/shared_snippets/installing_multiple_collections.txt index eb535d809f8..bd2d1a1e1c6 100644 --- a/docs/docsite/rst/shared_snippets/installing_multiple_collections.txt +++ b/docs/docsite/rst/shared_snippets/installing_multiple_collections.txt @@ -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