summaryrefslogtreecommitdiffstats
path: root/docs/docsite/rst/shared_snippets/installing_collections_file.rst
blob: 7c4fbcd9cb4ce402fea82d486d187f2ddde3e08d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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:
      - name: /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.