From 7e279f972e832d24cb6121667aee6cda57c7f9fc Mon Sep 17 00:00:00 2001 From: u348095 Date: Tue, 31 Jul 2012 16:21:24 +1000 Subject: [PATCH] Use sudo_user as an argument in the sudo command --- lib/ansible/runner/connection/local.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/runner/connection/local.py b/lib/ansible/runner/connection/local.py index 1779ffb45c5..c1aeb78c524 100644 --- a/lib/ansible/runner/connection/local.py +++ b/lib/ansible/runner/connection/local.py @@ -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)