From 6ba26e7556748a0b0efb038a2651585d68c13a15 Mon Sep 17 00:00:00 2001 From: Sandra McCann Date: Wed, 11 Dec 2019 14:02:55 -0500 Subject: [PATCH] Clarify how to install roles and collections from same requirements file (#65707) (#65736) (cherry picked from commit 5eceebcaf3328aafa8d0bcd9d3f280460217104f) --- 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 e1c0a0ee387..ed3128a3d2c 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