summaryrefslogtreecommitdiff
path: root/lib/ansible/cli/galaxy.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ansible/cli/galaxy.py')
-rwxr-xr-xlib/ansible/cli/galaxy.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/ansible/cli/galaxy.py b/lib/ansible/cli/galaxy.py
index fc88137ff6..0deb0331a5 100755
--- a/lib/ansible/cli/galaxy.py
+++ b/lib/ansible/cli/galaxy.py
@@ -1393,7 +1393,10 @@ class GalaxyCLI(CLI):
upgrade = context.CLIARGS.get('upgrade', False)
collections_path = C.COLLECTIONS_PATHS
- if len([p for p in collections_path if p.startswith(path)]) == 0:
+ if (
+ C.GALAXY_COLLECTIONS_PATH_WARNING
+ and len([p for p in collections_path if p.startswith(path)]) == 0
+ ):
display.warning("The specified collections path '%s' is not part of the configured Ansible "
"collections paths '%s'. The installed collection will not be picked up in an Ansible "
"run, unless within a playbook-adjacent collections directory." % (to_text(path), to_text(":".join(collections_path))))