|
|
|
@ -43,11 +43,12 @@ class ActionModule(object):
|
|
|
|
|
executable = v
|
|
|
|
|
module_args = r.sub("", module_args)
|
|
|
|
|
|
|
|
|
|
result = self.runner._low_level_exec_command(conn, module_args, tmp, sudoable=True, executable=executable)
|
|
|
|
|
result = self.runner._low_level_exec_command(conn, module_args, tmp, sudoable=True, executable=executable,
|
|
|
|
|
su=self.runner.su)
|
|
|
|
|
# for some modules (script, raw), the sudo success key
|
|
|
|
|
# may leak into the stdout due to the way the sudo/su
|
|
|
|
|
# command is constructed, so we filter that out here
|
|
|
|
|
if result.get('stdout','').startswith('SUDO-SUCCESS-'):
|
|
|
|
|
result['stdout'] = re.sub(r'^SUDO-SUCCESS.*(\r)?\n', '', result['stdout'])
|
|
|
|
|
if result.get('stdout','').strip().startswith('SUDO-SUCCESS-'):
|
|
|
|
|
result['stdout'] = re.sub(r'^(\r)?\nSUDO-SUCCESS.*(\r)?\n', '', result['stdout'])
|
|
|
|
|
|
|
|
|
|
return ReturnData(conn=conn, result=result)
|
|
|
|
|