mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 21:00:22 -07:00
Fixup the previous sudo_user support patch to work with playbooks.
This commit is contained in:
parent
5582e6a4f1
commit
05545e3735
3 changed files with 26 additions and 13 deletions
|
@ -52,7 +52,7 @@ class Cli(object):
|
|||
parser.add_option('-m', '--module-name', dest='module_name',
|
||||
help="module name to execute (default=%s)" % C.DEFAULT_MODULE_NAME,
|
||||
default=C.DEFAULT_MODULE_NAME)
|
||||
parser.add_option('-U','--sudo_user', dest='sudo_user', help='desired sudo user',
|
||||
parser.add_option('-U','--sudo-user', dest='sudo_user', help='desired sudo user (default=root)',
|
||||
default=C.DEFAULT_SUDO_USER)
|
||||
options, args = parser.parse_args()
|
||||
self.callbacks.options = options
|
||||
|
@ -82,6 +82,8 @@ class Cli(object):
|
|||
sshpass = getpass.getpass(prompt="SSH password: ")
|
||||
if options.ask_sudo_pass:
|
||||
sudopass = getpass.getpass(prompt="sudo password: ")
|
||||
if options.sudo_user:
|
||||
options.sudo=True
|
||||
|
||||
if options.tree:
|
||||
utils.prepare_writeable_dir(options.tree)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue