-
Notifications
You must be signed in to change notification settings - Fork 23.8k
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
Add ansible_shell_interpreter, or some other way to globally set the executable used by the shell module #35446
Comments
Files identified in the description: If these files are inaccurate, please update the |
There is a ansible_shell_executable (http://docs.ansible.com/ansible/latest/intro_inventory.html#list-of-behavioral-inventory-parameters). Would that work for your use case? If not, what is missing? See also #24169 and related pr #31361 (and for more context, also the now reverted #24177 |
Oh wow. I searched for this for quite a while and couldn't find it - not in the docs, not on google, not on irc... Yes, ansible_shell_executable seems to be what I was looking for. Why the inconsistent naming though ? Also, could info about ansible_shell_executable be added here https://docs.ansible.com/ansible/latest/shell_module.html ? Thanks! |
@wknapik that is different, the setting controls the shell used for executing modules, not the shell used by the shell module. |
@bcoca - well, you say that...
Works for me. |
i did not say it wouldn't work, but it is not 'on purpose', but a side effect, it was not meant as a default for the 'shell' module just what to use when executing modules. |
To me, that calls for the introduction of If the current effect of I suppose few would actually need to execute all modules with shell X and use shell Y with the |
this is a subset of 'defaults for modules' which we do not have a facility for. closing as dupe/subset of ansible/proposals#81 |
ISSUE TYPE
Feature Idea
COMPONENT NAME
shell
ANSIBLE VERSION
2.5.0.34964.01091cddf6-1
CONFIGURATION
DEFAULT_STDOUT_CALLBACK(/etc/ansible/ansible.cfg) = debug
OS / ENVIRONMENT
N/A
SUMMARY
There should be a way to set the preferred shell executable globally, instead of having to do it in every single shell module invocation.
I have a bunch of roles here with a total of 39 shell tasks. Adding
args: executable=bash
in 39 places is just... wrong.Also, it would be great to be able to set it to
/usr/bin/env bash
, instead of a path, like/usr/bin/bash
, etc., since those vary between systems.STEPS TO REPRODUCE
N/A
EXPECTED RESULTS
One global setting.
ACTUAL RESULTS
No global setting.
The text was updated successfully, but these errors were encountered: