File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -374,11 +374,13 @@ def run( # ruff: disable=PLR0913
374
374
tee : bool = False ,
375
375
env : dict [str , str ] | None = None ,
376
376
cwd : Path | None = None ,
377
+ set_acp : bool = True ,
377
378
) -> CompletedProcess :
378
379
"""Execute a command inside an Ansible environment.
379
380
380
381
:param retry: Retry network operations on failures.
381
382
:param tee: Also pass captured stdout/stderr to system while running.
383
+ :param set_acp: Set the ANSIBLE_COLLECTIONS_PATH
382
384
"""
383
385
if tee :
384
386
run_func : Callable [..., CompletedProcess ] = subprocess_tee .run
@@ -392,8 +394,7 @@ def run( # ruff: disable=PLR0913
392
394
# https://github.com/ansible/ansible-lint/issues/3522
393
395
env ["ANSIBLE_VERBOSE_TO_STDERR" ] = "True"
394
396
395
- # Assume the caller has a proper env, if not use a sane default
396
- if "ANSIBLE_COLLECTIONS_PATH" not in env :
397
+ if set_acp :
397
398
env ["ANSIBLE_COLLECTIONS_PATH" ] = ":" .join (self .config .collections_paths )
398
399
399
400
for _ in range (self .max_retries + 1 if retry else 1 ):
You can’t perform that action at this time.
0 commit comments