From 80a84f25e277b0de2620acadc927606b17004362 Mon Sep 17 00:00:00 2001 From: Sutapa Bhattacharjee <129940487+BhattacharjeeSutapa@users.noreply.github.com> Date: Mon, 19 Feb 2024 22:16:30 +0530 Subject: [PATCH] Add example around ansible-galaxy command (#1053) Co-authored-by: Don Naro (cherry picked from commit 1d8e851c0fa0e44f66085ce679def62e74313add) --- docs/docsite/rst/command_guide/cheatsheet.rst | 43 ++++++++++++++++--- 1 file changed, 36 insertions(+), 7 deletions(-) diff --git a/docs/docsite/rst/command_guide/cheatsheet.rst b/docs/docsite/rst/command_guide/cheatsheet.rst index 9f4f3c395f2..56eef5802e9 100644 --- a/docs/docsite/rst/command_guide/cheatsheet.rst +++ b/docs/docsite/rst/command_guide/cheatsheet.rst @@ -35,20 +35,49 @@ See :ref:`ansible-playbook` for detailed documentation. ansible-galaxy ============== -Installing a collection: +Installing collections +^^^^^^^^^^^^^^^^^^^^^^ + +* Install a single collection: .. code-block:: bash - ansible-galaxy collection install mynamespace.mycollection + ansible-galaxy collection install mynamespace.mycollection -Downloads ``mynamespace.mycollection`` from the configured Galaxy server (``_ by default). - +Downloads ``mynamespace.mycollection`` from the configured Galaxy server (`galaxy.ansible.com` by default). -Listing all installed collections: +* Install a list of collections: .. code-block:: bash - ansible-galaxy collection list + ansible-galaxy collection install -r requirements.yml -See :ref:`ansible-galaxy` for detailed documentation. +Downloads the list of collections specified in the ``requirements.yml`` file. + +* List all installed collections: + +.. code-block:: bash + + ansible-galaxy collection list + +Installing roles +^^^^^^^^^^^^^^^^ + +* Install a role named `example.role`: + +.. code-block:: bash + + ansible-galaxy role install example.role + + # SNIPPED_OUTPUT + - extracting example.role to /home/user/.ansible/roles/example.role + - example.role was installed successfully + + +* List all installed roles: +.. code-block:: bash + + ansible-galaxy role list + +See :ref:`ansible-galaxy` for detailed documentation.