From 911aa6aab9aea867bc79e38684ab1b198fa36937 Mon Sep 17 00:00:00 2001 From: Chris Houseknecht Date: Wed, 2 Oct 2019 10:22:00 -0400 Subject: [PATCH] Default collection install path to first path in COLLECTIONS_PATHS (#62870) --- .../62870-collection-install-default-path.yml | 2 ++ .../docsite/rst/dev_guide/developing_collections.rst | 12 ++++++++---- docs/docsite/rst/user_guide/collections_using.rst | 8 +++++--- lib/ansible/cli/galaxy.py | 3 ++- 4 files changed, 17 insertions(+), 8 deletions(-) create mode 100644 changelogs/fragments/62870-collection-install-default-path.yml diff --git a/changelogs/fragments/62870-collection-install-default-path.yml b/changelogs/fragments/62870-collection-install-default-path.yml new file mode 100644 index 00000000000..dab3b5d2c98 --- /dev/null +++ b/changelogs/fragments/62870-collection-install-default-path.yml @@ -0,0 +1,2 @@ +bugfixes: +- ansible-galaxy - Default collection install path to first path in COLLECTIONS_PATHS (https://github.com/ansible/ansible/pull/62870) diff --git a/docs/docsite/rst/dev_guide/developing_collections.rst b/docs/docsite/rst/dev_guide/developing_collections.rst index 5a6bc4d0e02..5466767afd1 100644 --- a/docs/docsite/rst/dev_guide/developing_collections.rst +++ b/docs/docsite/rst/dev_guide/developing_collections.rst @@ -245,15 +245,19 @@ as a distribution method, but you can use it directly to install the collection Trying collection locally ------------------------- -You can try your collection locally by installing it from the tarball. +You can try your collection locally by installing it from the tarball. The following will enable an adjacent playbook to +access the collection: .. code-block:: bash - ansible-galaxy collection install my_namespace-my_collection-1.0.0.tar.gz -p ./collections/ansible_collections + ansible-galaxy collection install my_namespace-my_collection-1.0.0.tar.gz -p ./collections -You should use one of the values configured in :ref:`COLLECTIONS_PATHS` for your path. This is also where Ansible itself will expect to find collections when attempting to use them. -Then try to use the local collection inside a playbook, for more details see :ref:`Using collections ` +You should use one of the values configured in :ref:`COLLECTIONS_PATHS` for your path. This is also where Ansible itself will +expect to find collections when attempting to use them. If you don't specify a path value, ``ansible-galaxy collection install`` +installs the collection in the first path defined in :ref:`COLLECTIONS_PATHS`, which by default is ``~/.ansible/collections``. + +Next, try using the local collection inside a playbook. For examples and more details see :ref:`Using collections ` .. _publishing_collections: diff --git a/docs/docsite/rst/user_guide/collections_using.rst b/docs/docsite/rst/user_guide/collections_using.rst index 062e21d6fff..eac81d5e17a 100644 --- a/docs/docsite/rst/user_guide/collections_using.rst +++ b/docs/docsite/rst/user_guide/collections_using.rst @@ -17,13 +17,13 @@ You can install and use collections through `Ansible Galaxy