docs: def exec_command(self, cmd, tmp_path, sudo_user, sudoable=False, executable='/bin/sh'):
          ''' run a command on the local host '''
  
          if not self.runner.sudo or not sudoable:
              if executable:
                  local_cmd = [executable, '-c', cmd]
              else:
                  local_cmd = cmd
          else:
              local_cmd, prompt = utils.make_sudo_cmd(sudo_user, executable, cmd)
  
          vvv("EXEC %s" % (local_cmd), host=self.host)
          p = subprocess.Popen(local_cmd, shell=isinstance(local_cmd, basestring),
                               cwd=self.runner.basedir, executable=executable or None,
                               stdin=subprocess.PIPE,
                               stdout=subprocess.PIPE, stderr=subprocess.PIPE)
  
          if self.runner.sudo and sudoable and self.runner.sudo_pass:
              fcntl.fcntl(p.stdout, fcntl.F_SETFL,
                          fcntl.fcntl(p.stdout, fcntl.F_GETFL) | os.O_NONBLOCK)
              fcntl.fcntl(p.stderr, fcntl.F_SETFL,
                          fcntl.fcntl(p.stderr, fcntl.F_GETFL) | os.O_NONBLOCK)
              sudo_output = ''
              while not sudo_output.endswith(prompt):
                  rfd, wfd, efd = select.select([p.stdout, p.stderr], [],
                                                [p.stdout, p.stderr], self.runner.timeout)
                  if p.stdout in rfd:
                      chunk = p.stdout.read()
                  elif p.stderr in rfd:
                      chunk = p.stderr.read()
                  else:
                      stdout, stderr = p.communicate()
                      raise errors.AnsibleError('timeout waiting for sudo password prompt:\n' + sudo_output)
                  if not chunk:
                      stdout, stderr = p.communicate()
                      raise errors.AnsibleError('sudo output closed while waiting for password prompt:\n' + sudo_output)
                  sudo_output += chunk
              p.stdin.write(self.runner.sudo_pass + '\n')
              fcntl.fcntl(p.stdout, fcntl.F_SETFL, fcntl.fcntl(p.stdout, fcntl.F_GETFL) & ~os.O_NONBLOCK)
              fcntl.fcntl(p.stderr, fcntl.F_SETFL, fcntl.fcntl(p.stderr, fcntl.F_GETFL) & ~os.O_NONBLOCK)
  
          stdout, stderr = p.communicate()
          return (p.returncode, '', stdout, stderr)