first bit of getting sudo -u functionality

This commit is contained in:
Jim Richardson 2012-05-03 16:08:36 -07:00 committed by Michael DeHaan
parent 36559badd5
commit 93a20a33e9
3 changed files with 9 additions and 4 deletions

View file

@ -77,8 +77,8 @@ class Runner(object):
remote_pass=C.DEFAULT_REMOTE_PASS, remote_port=C.DEFAULT_REMOTE_PORT,
sudo_pass=C.DEFAULT_SUDO_PASS, background=0, basedir=None,
setup_cache=None, transport=C.DEFAULT_TRANSPORT, conditional='True',
callbacks=None, debug=False, sudo=False, module_vars=None,
is_playbook=False, inventory=None):
callbacks=None, debug=False, sudo=False, sudo_user=C.DEFAULT_SUDO_USER
,module_vars=None, is_playbook=False, inventory=None):
"""
host_list : path to a host list file, like /etc/ansible/hosts
@ -91,6 +91,7 @@ class Runner(object):
remote_user : connect as this remote username
remote_pass : supply this password (if not using keys)
remote_port : use this default remote port (if not set by the inventory system)
sudo_user : If you want to sudo to a user other than root.
sudo_pass : sudo password if using sudo and sudo requires a password
background : run asynchronously with a cap of this many # of seconds (if not 0)
basedir : paths used by modules if not absolute are relative to here
@ -143,6 +144,7 @@ class Runner(object):
self.basedir = basedir
self.sudo = sudo
self.sudo_pass = sudo_pass
self.sudo_user = sudo_user
self.is_playbook = is_playbook
euid = pwd.getpwuid(os.geteuid())[0]