Skip to content

Commit

Permalink
Support ANSIBLE_COLLECTIONS_PATH environment var (#3681)
Browse files Browse the repository at this point in the history
This commit adds supports for reading ANSIBLE_COLLECTIONS_PATH from the
environment, in a similar manner to how ANSIBLE_ROLES_PATH is handled.
  • Loading branch information
nre-ableton committed Oct 19, 2022
1 parent 3ff57d4 commit 144bbae
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/molecule/provisioner/ansible.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,15 @@ def default_env(self):
]
)

if os.environ.get("ANSIBLE_COLLECTIONS_PATH", ""):
collections_path_list.extend(
list(
map(
util.abs_path, os.environ["ANSIBLE_COLLECTIONS_PATH"].split(":")
)
)
)

roles_path_list = [
util.abs_path(
os.path.join(self._config.scenario.config.runtime.cache_dir, "roles")
Expand Down

0 comments on commit 144bbae

Please sign in to comment.