Skip to content

Commit

Permalink
Revert #196 for ansible 2.9 (#202)
Browse files Browse the repository at this point in the history
  • Loading branch information
cidrblock authored Aug 1, 2023
1 parent cf0bb6b commit fe8ae39
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/tox_ansible/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,10 +534,17 @@ def conf_passenv() -> list[str]:
def conf_setenv(env_conf: EnvConfigSet) -> str:
"""Build the set environment variables for the tox environment.
ansible 2.9 did not support the ANSIBLE_COLLECTION_PATH environment variable
ansible 2.16 has it marked for deprecation in 2.19
:param env_conf: The environment configuration.
:return: The set environment variables.
"""
if env_conf.name.endswith("2.9"):
envvar_name = "ANSIBLE_COLLECTIONS_PATHS"
else:
envvar_name = "ANSIBLE_COLLECTIONS_PATH"
envtmpdir = env_conf["envtmpdir"]
setenv = []
setenv.append(f"ANSIBLE_COLLECTIONS_PATH={envtmpdir}/collections/")
setenv.append(f"{envvar_name}={envtmpdir}/collections/")
return "\n".join(setenv)

0 comments on commit fe8ae39

Please sign in to comment.