title: Ansible operations on Juniper devices fail with "sftp/scp transfer mechanism failed"
body: <p>My playbook:</p>
  <pre class="lang-yaml prettyprint-override"><code>- name: get junos facts
    hosts: sw
  #  connection: local
    gather_facts: no
    roles:
      - juniper.junos
  
    tasks:
  
      - name: Retrieve Junos OS version
        junipernetworks.junos.junos_command:
          commands: show version
  </code></pre>
  <p>hosts:</p>
  <pre><code>[sw]
  EX4200-2
  EX4200-1
  </code></pre>
  <p>vars:</p>
  <pre><code>ansible_network_os: juniper_junos
  </code></pre>
  <p>Ansible config</p>
  <pre><code>ansible-playbook [core 2.12.1]
    config file = /usr/local/san/ansible/ansible.cfg
    configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
    ansible python module location = /usr/local/python/python38/lib/python3.8/site-packages/ansible
    ansible collection location = /root/.ansible/collections/ansible_collections
    executable location = /usr/local/python/python38/bin/ansible-playbook
    python version = 3.8.10 (default, Dec 30 2021, 10:44:47) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)]
    jinja version = 3.0.3
    libyaml = True
  </code></pre>
  <p>The result of running the playbook</p>
  <pre class="lang-json prettyprint-override"><code>[WARNING]: sftp transfer mechanism failed on [10.1.1.196]. Use ANSIBLE_DEBUG=1 to see detailed information
  
  &lt;10.1.1.196&gt; SSH: EXEC sshpass -d13 scp -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'User=&quot;admin&quot;' -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/0d45650285 /root/.ansible/tmp/ansible-local-3715dofr3qmk/tmpiaq5tnso '[10.1.1.196]:'&quot;'&quot;'error: unknown command: /bin/sh/AnsiballZ_junos_command.py'&quot;'&quot;''
  
  [WARNING]: scp transfer mechanism failed on [10.1.1.196]. Use ANSIBLE_DEBUG=1 to see detailed information
  &lt;10.1.1.196&gt; ESTABLISH SSH CONNECTION FOR USER: xxx
  &lt;10.1.1.196&gt; SSH: EXEC sshpass -d13 ssh -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'User=&quot;admin&quot;' -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/0d45650285 10.1.1.196 'dd of=error: unknown command: /bin/sh/AnsiballZ_junos_command.py bs=65536'
  &lt;10.1.1.254&gt; (0, b'\nerror: unknown command: /bin/sh\n', b'')
  ...
  fatal: [EX4200-2]: FAILED! =&gt; {
      &quot;changed&quot;: false,
      &quot;module_stderr&quot;: &quot;Shared connection to 10.1.1.196 closed.\r\n&quot;,
      &quot;module_stdout&quot;: &quot;\r\nerror: unknown command: /bin/sh\r\n&quot;,
      &quot;msg&quot;: &quot;MODULE FAILURE\nSee stdout/stderr for the exact error&quot;,
      &quot;rc&quot;: 0
  }
  </code></pre>
  <p>Looks like there was a problem with SCP and SFTP. But it is normal for me to execute SCP and SFTP manually.</p>
  <p>How can I fix this mistake?</p>