Merge pull request #963 from rutsky/bastion-ansible-host

handle both 'ansible_host' and 'ansible_ssh_host' in bastion configration
This commit is contained in:
Antoine Legrand 2017-02-04 15:42:39 -05:00 committed by GitHub
commit bd1c764a1a

View file

@ -4,7 +4,7 @@
{% for h in groups['all'] %}
{% if h != 'bastion' %}
{% if vars.update({'hosts': vars['hosts'] + ' ' + hostvars[h]['ansible_ssh_host']}) %}{% endif %}
{% if vars.update({'hosts': vars['hosts'] + ' ' + (hostvars[h].get('ansible_ssh_host') or hostvars[h]['ansible_host'])}) %}{% endif %}
{% endif %}
{% endfor %}
@ -18,4 +18,4 @@ Host {{ bastion_ip }}
Host {{ vars['hosts'] }}
ProxyCommand ssh -W %h:%p {{ real_user }}@{{ bastion_ip }}
StrictHostKeyChecking no
{% endif %}
{% endif %}