{% raw %} # Connect to target node through jump host # # OpenSSH 7.3: # ProxyJump jumphost # before OpenSSH 7.3 # ProxyCommand ssh -o 'ForwardAgent yes' jumphost 'ssh-add && nc %h %p' {% for (name, host) in hosts_meta.items() %} Host {{ name }} HostName {{ host.ansible_ssh_host }} User {{ host.ansible_user }} {% if proxy_jump %} ProxyCommand ssh -o 'ForwardAgent yes' {{ installer_host }} 'ssh-add && nc %h %p' {% endif %} {% endfor %} {% endraw %}