2016-12-09 09:38:17 +00:00
|
|
|
{% set vars={'hosts': ''} %}
|
|
|
|
{% set user='' %}
|
|
|
|
|
|
|
|
{% for h in groups['all'] %}
|
2018-10-10 02:14:33 +00:00
|
|
|
{% if h not in groups['bastion'] %}
|
2017-02-02 15:33:05 +00:00
|
|
|
{% if vars.update({'hosts': vars['hosts'] + ' ' + (hostvars[h].get('ansible_ssh_host') or hostvars[h]['ansible_host'])}) %}{% endif %}
|
2016-12-09 09:38:17 +00:00
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
|
|
|
|
Host {{ bastion_ip }}
|
|
|
|
Hostname {{ bastion_ip }}
|
|
|
|
StrictHostKeyChecking no
|
|
|
|
ControlMaster auto
|
|
|
|
ControlPath ~/.ssh/ansible-%r@%h:%p
|
|
|
|
ControlPersist 5m
|
|
|
|
|
|
|
|
Host {{ vars['hosts'] }}
|
2021-03-26 07:48:43 +00:00
|
|
|
ProxyCommand ssh -F /dev/null -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -W %h:%p -p {{ bastion_port }} {{ real_user }}@{{ bastion_ip }} {% if ansible_ssh_private_key_file is defined %}-i {{ ansible_ssh_private_key_file }}{% endif %}
|