title: How to make ansible connect to windows host behind linux jump server
body: <p>I want to provision Windows host that is in subnet accessible only with Linux jump host.</p>
  
  <p>Windows machine uses winrm connection method.
  Linux jump server is available via SSH.</p>
  
  <p>I have no problem accessing windows host if available directly with:</p>
  
  <pre><code>ansible_connection: winrm
  </code></pre>
  
  <p>If I try to delegate the task to the Linux jump server (that has direct access to Windows) by:</p>
  
  <pre><code>- name: Ping windows
    hosts: windows_machines
    tasks:
      - name: ping
        win_ping:
        delegate_to: "{{ item }}"
        with_items: "{{ groups['jump_servers'][0] }}"
  </code></pre>
  
  <p>it tries to connect to establish WINRM connection to the jump host. Not exactly what I had in mind.</p>
  
  <p>Note that for windows_machines group I have group_vars defined:</p>
  
  <pre><code>ansible_port: 5986
  ansible_connection: winrm
  ansible_winrm_server_cert_validation: ignore
  </code></pre>
  
  <p>How should I provision Windows hosts via a bastion host?</p>