Nicely explained and thanks, Matt. How should we handle running
'ansible' with '--ask-sudo-pass' but without '--sudo' then?
1. Have '--ask-sudo-pass' trigger an error for 'ansible' without '--sudo'.
But what of 'ask_sudo_pass = True' in ansible.cfg when you run
'ansible' without '--sudo'? Is this going to be a problem then for
running ad-hoc commands, when you have to be forced to pass in
'--sudo', or be errored out?
2. Go ahead and make passing '--ask-sudo-pass' to 'ansible' (whether
at the command line, or as part of the config) make it imply '--sudo'.
If you have 'ask_sudo_pass = True' in your config, this is going to be
a problem for you because now all ad-hoc commands will be run with
'--sudo'!
3. (current behaviour right now) Have "--ask-sudo-pass" (whether at
the command line, or as part of the config) *not* imply "--sudo" for
'ansible', even though one might be so tempted to make the
implication.
Slightly unintuitive (at the command line), and
If you have 'ask_sudo_pass = True' in your ansible config, also has
the slightly irritating behaviour of making ad-hoc commands ask for a
password every time, '--sudo' or no '--sudo'. But solves the problem
of 2!
4. (an interesting thought) Given all the attendant problems in 1, 2,
and 3 with 'ask_sudo_pass = True' in the config... would be it
possible to make ad-hoc commands *ignore* the 'ask_sudo_pass' setting
in ansible.cfg? I'm not really pushing for this, but it just struck
me, and I'm putting it out there as a thought experiment....
thanks all,
-jf