title: Ansible included play task get error "failed to open a SFTP connection"
body: <p>I have one playbook initiated by another using include setup as follows.</p>
  
  <p>parent.yml </p>
  
  <pre><code>- hosts: localhost
    gather_facts: False
  
    tasks:
     - add_host:
         name: "{{ item.value['hostname'] }}"
         ansible_host: "{{ item.value['oob_ip'] }}"
         ansible_user: "{{ servers.web_servers.vars.ilousername }}"
         ansible_ssh_pass: "{{ servers.web_servers.vars.ilopassword }}"
         group: ilohosts
  - hosts: ilohosts 
    tasks:
      - include: collect_mac.yml
  </code></pre>
  
  <p>collect_mac.yml</p>
  
  <pre><code>#- set_fact: 
  #    ansible_ssh_pass: "{{ servers.web_servers.vars.ilopassword }}"
  
  - name: collect MAC address
    raw: "racadm getsysinfo"
    register: eth_info
  </code></pre>
  
  <p>The rest of the yml I have stripped out. As its few regex to grab the MAC address.</p>
  
  <p>The issue is that when I run the collect_mac.yml as a separate playbook adding the headers and including the same hosts in an inventory file. </p>
  
  <pre><code>- name: collect mac
    hosts: hosts
    remote_user: root
    gather_facts: False
  </code></pre>
  
  <p>It run without an issue. But when its ran via the parent.yml, I get the following error</p>
  
  <pre><code>{"msg": "failed to open a SFTP connection (Garbage packet received)"} 
  </code></pre>
  
  <p>Why ansible tries to open an SFTP session, instead of SSH and run the raw command?</p>