mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
commit
224b503b78
1 changed files with 1 additions and 1 deletions
|
@ -544,6 +544,6 @@ def make_sudo_cmd(sudo_user, executable, cmd):
|
||||||
# the -p option.
|
# the -p option.
|
||||||
randbits = ''.join(chr(random.randint(ord('a'), ord('z'))) for x in xrange(32))
|
randbits = ''.join(chr(random.randint(ord('a'), ord('z'))) for x in xrange(32))
|
||||||
prompt = '[sudo via ansible, key=%s] password: ' % randbits
|
prompt = '[sudo via ansible, key=%s] password: ' % randbits
|
||||||
sudocmd = 'sudo -k && sudo -S -p "%s" -u %s %s -c %s' % (
|
sudocmd = 'sudo -k && sudo -S -p "%s" -i -u %s %s -c %s' % (
|
||||||
prompt, sudo_user, executable or '$SHELL', pipes.quote(cmd))
|
prompt, sudo_user, executable or '$SHELL', pipes.quote(cmd))
|
||||||
return ('/bin/sh -c ' + pipes.quote(sudocmd), prompt)
|
return ('/bin/sh -c ' + pipes.quote(sudocmd), prompt)
|
||||||
|
|
Loading…
Reference in a new issue