'Run list of commands on remote device and return results'

def run_commands(self, commands, check_rc=True):

    responses = list()
    for cmd in to_list(commands):
        (rc, out, err) = self.exec_command(cmd)
        out = to_text(out, errors='surrogate_then_replace')
        if (check_rc and (rc != 0)):
            self._module.fail_json(msg=to_text(err, errors='surrogate_then_replace'))
        try:
            out = self._module.from_json(out)
        except ValueError:
            out = str(out).strip()
        responses.append(out)
    return responses
