Skip to content

Commit

Permalink
Documentation for other types in collection requirements.yml (ansib…
Browse files Browse the repository at this point in the history
  • Loading branch information
lilatomic authored Nov 9, 2021
1 parent 55dc75b commit be2bd2f
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 6 deletions.
5 changes: 5 additions & 0 deletions docs/docsite/rst/galaxy/user_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ Downloading a collection for offline use

.. include:: ../shared_snippets/download_tarball_collections.txt

Installing a collection from source files
-----------------------------------------

.. include:: ../shared_snippets/installing_collections_file.rst

Installing a collection from a git repository
---------------------------------------------

Expand Down
24 changes: 24 additions & 0 deletions docs/docsite/rst/shared_snippets/installing_collections_file.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Ansible can also install from a source directory in several ways:

.. code-block:: yaml
collections:
# directory containing the collection
- source: ./my_namespace/my_collection/
type: dir
# directory containing a namespace, with collections as subdirectories
- source: ./my_namespace/
type: subdirs
Ansible can also install a collection collected with ``ansible-galaxy collection build`` or downloaded from Galaxy for offline use by specifying the output file directly:

.. code-block:: yaml
collections:
- source: /tmp/my_namespace-my_collection-1.0.0.tar.gz
type: file
.. note::

Relative paths are calculated from the current working directory (where you are invoking ``ansible-galaxy install -r`` from). They are not taken relative to the ``requirements.yml`` file.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ You can specify four keys for each collection entry:

The ``version`` key uses the same range identifier format documented in :ref:`collections_older_version`.

The ``type`` key can be set to ``galaxy``, ``url``, ``file``, and ``git``. If ``type`` is omitted, the ``name`` key is used to implicitly determine the source of the collection.
The ``type`` key can be set to ``file``, ``galaxy``, ``git``, ``url``, ``dir``, or ``subdirs``. If ``type`` is omitted, the ``name`` key is used to implicitly determine the source of the collection.

When you install a collection with ``type: git``, the ``version`` key can refer to a branch or to a `git commit-ish <https://git-scm.com/docs/gitglossary#def_commit-ish>`_ object (commit or tag). For example:

Expand Down
14 changes: 9 additions & 5 deletions docs/docsite/rst/user_guide/collections_using.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@ Installing an older version of a collection

.. include:: ../shared_snippets/installing_older_collection.txt

Installing a collection from a git repository
---------------------------------------------

.. include:: ../shared_snippets/installing_collections_git_repo.txt

.. _collection_requirements_file:

Install multiple collections with a requirements file
Expand All @@ -56,6 +51,15 @@ Downloading a collection for offline use

.. include:: ../shared_snippets/download_tarball_collections.txt

Installing a collection from source files
-----------------------------------------

.. include:: ../shared_snippets/installing_collections_file.rst

Installing a collection from a git repository
---------------------------------------------

.. include:: ../shared_snippets/installing_collections_git_repo.txt

.. _galaxy_server_config:

Expand Down

0 comments on commit be2bd2f

Please sign in to comment.