Ansible execute remote ssh task
<p>I have tried connecting to a remote "custom" Linux vm, and copied my ssh public ssh it, yet, I'm able to get Ansible to ping / connect it, as I keep getting remote host unreachable. "<em>I think its because its running custom version of linux and ssh auth might be behaving differently</em>"   </p>

<p>The following remote ssh command works </p>

<pre><code> # ssh -t user@server_ip "show vd"
 password: mypassword
</code></pre>

<p>I'm trying to convert this above command to an Ansible playbook </p>

<pre><code>---
- hosts: server_ip
  gather_facts: no
  remote_user: root

  tasks:
    - name: check devise status
      shell: ssh -i server_ip "show vd"
      register: output

    - expect:
      command: sh "{{ output.stdout }}"
      responses:
        (?i)password: user
</code></pre>

<p>I'm unable to get it to work, and I'm not sure if this is the write way of doing it, your input is highly appreciated it. </p>