Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passdown ANSIBLE_LIBRARY shell environment variable #2754

Merged
merged 3 commits into from
Jul 19, 2020

Conversation

ssbarnea
Copy link
Member

Fixes: #2651

@ssbarnea ssbarnea merged commit 17c5da0 into ansible:master Jul 19, 2020
@ssbarnea ssbarnea deleted the shell-env branch July 19, 2020 12:14
@ssbarnea ssbarnea added the bug label Aug 17, 2020
@@ -930,6 +930,10 @@ def _get_modules_directories(self):
"/usr/share/ansible/plugins/modules",
]
)

if os.environ.get("ANSIBLE_LIBRARY"):
paths.extend([util.abs_path(os.environ.get("ANSIBLE_LIBRARY"))])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should have been added first because ANSIBLE_LIBRARY being passed in likely should take priority over the computed one. In our instance the system path takes precedence over the testing one if the same module is in both places.

ANSIBLE_LIBRARY gets set to:
-> /home/stack/test-python/lib/python3.6/site-packages/molecule/provisioner/ansible/plugins/modules
-> /home/stack/.cache/molecule/tripleo_network_config/default/library
-> /home/stack/tripleo-ansible/tripleo_ansible/roles/tripleo_network_config/library
-> /home/stack/.ansible/plugins/modules
-> /usr/share/ansible/plugins/modules
-> /home/stack/tripleo-ansible/tripleo_ansible/roles.galaxy/config_template/library
-> /home/stack/tripleo-ansible/tripleo_ansible/ansible_plugins/modules
-> /home/stack/.cache/ansible-lint/128d82/modules
-> /home/stack/tripleo-ansible/tripleo_ansible/ansible_plugins/modules

meaning the same module in /usr/share/ansible/plugins/mopdules takes precedence over out testing version in /home/stack/tripleo-ansible/tripleo_ansible/ansible_plugins/modules

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing Shell Environment Variables
2 participants