I’m not sure this is the right place for it, I’m also looking at the doc site and we have some of this there, but not all.
There are many cases in which people report ‘X’ is not working event though I configured/set/pass this option, 95% of cases this is due to a conflicting setting with higher precedence.
- The CLI tool
ansible-config dump -t all --only-changed
, this will dump the configuration for ‘base and all plugins’, but only those items that are not using defaults. and you can even grep for your the exact key|grep DEFAULT_BECOME
- The
config
lookup, this is useful as it will also pick up more of the in task context{{ q("config", "DEFAULT_BECOME", show_origin=True)}}
- The ‘vars’ and ‘varnames’ lookups, which will add the most details variable context
{{ q("varnames", "ansible_become", "ansible_sudo")) }}
will tell us if they are set and{{ q("vars", "ansible_become", "ansible_sudo") }}
will tell us their values.
A common pattern that was used in older versions was just to look at ansible_user
or other variables of that type which were ‘sometimes’ set and sometimes even to the correct value! This is not and was never reliable, the config
plugin should be used instead.
One issue the config
plugin has is the lack of host/variable context, which is something I’m working on adding so it can become a ‘one stop shop’ to find out what is really set when your task executes.