You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
674 B

  1. {% set vars={'hosts': ''} %}
  2. {% set user='' %}
  3. {% for h in groups['all'] %}
  4. {% if h not in groups['bastion'] %}
  5. {% if vars.update({'hosts': vars['hosts'] + ' ' + (hostvars[h].get('ansible_ssh_host') or hostvars[h]['ansible_host'])}) %}{% endif %}
  6. {% endif %}
  7. {% endfor %}
  8. Host {{ bastion_ip }}
  9. Hostname {{ bastion_ip }}
  10. StrictHostKeyChecking no
  11. ControlMaster auto
  12. ControlPath ~/.ssh/ansible-%r@%h:%p
  13. ControlPersist 5m
  14. Host {{ vars['hosts'] }}
  15. ProxyCommand ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -W %h:%p {{ real_user }}@{{ bastion_ip }} {% if ansible_ssh_private_key_file is defined %}-i {{ ansible_ssh_private_key_file }}{% endif %}