mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Use sudo_user as an argument in the sudo command
This commit is contained in:
parent
ce5f3dd148
commit
7e279f972e
1 changed files with 1 additions and 1 deletions
|
@ -42,7 +42,7 @@ class LocalConnection(object):
|
|||
# to do so. The primary usage of the local connection is for crontab and kickstart usage however
|
||||
# so this doesn't seem to be a huge priority
|
||||
raise errors.AnsibleError("sudo with password is presently only supported on the paramiko (SSH) connection type")
|
||||
cmd = "sudo -s %s" % cmd
|
||||
cmd = "sudo -u {0} -s {1}".format(sudo_user, cmd)
|
||||
|
||||
p = subprocess.Popen(cmd, shell=True, stdin=None,
|
||||
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
|
|
Loading…
Reference in a new issue