add: new option GALAXY_COLLECTIONS_INSTALL_PATH

pull/83943/head
rcordier 2 months ago
parent 33d4ba8fa2
commit df53297473

@ -708,6 +708,15 @@ class GalaxyCLI(CLI):
return self.lazy_role_api.api
def _get_default_collection_path(self):
if isinstance(C.GALAXY_COLLECTIONS_INSTALL_PATH, list) and \
len(C.GALAXY_COLLECTIONS_INSTALL_PATH) > 0 :
path_candidates = C.GALAXY_COLLECTIONS_INSTALL_PATH
for _path in path_candidates:
if os.path.isdir(_path):
return _path
return path_candidates[0]
return C.COLLECTIONS_PATHS[0]
def _parse_requirements_file(self, requirements_file, allow_old_format=True, artifacts_manager=None, validate_signature_options=True):

@ -227,6 +227,22 @@ COLLECTIONS_PATHS:
- key: collections_path
section: defaults
version_added: '2.10'
GALAXY_COLLECTIONS_INSTALL_PATH:
name: preferred collection install path
description: >
Preferred install path for collection. If empty or not set, fallback on first ``COLLECTIONS_PATHS`` path.
If one or more paths are provided, the first existing directory is selected. If no directory exists, it
will use the last one of the list. If the selected path is not in the ``COLLECTIONS_PATHS`` list, then
a warning is raised, unless ``GALAXY_COLLECTIONS_PATH_WARNING`` is set to ``false``.
default: null
type: pathspec
env:
- name: ANSIBLE_GALAXY_COLLECTIONS_INSTALL_PATH
version_added: '2.16'
ini:
- key: collections_install_path
section: defaults
version_added: '2.10'
COLLECTIONS_ON_ANSIBLE_VERSION_MISMATCH:
name: Defines behavior when loading a collection that does not support the current Ansible version
description:

Loading…
Cancel
Save