Skip to content
Snippets Groups Projects
Commit bd1c764a authored by Antoine Legrand's avatar Antoine Legrand Committed by GitHub
Browse files

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

handle both 'ansible_host' and 'ansible_ssh_host' in bastion configration
parents 8f377ad8 b4327fdc
No related branches found
No related tags found
No related merge requests found
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
{% for h in groups['all'] %} {% for h in groups['all'] %}
{% if h != 'bastion' %} {% 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 %} {% endif %}
{% endfor %} {% endfor %}
...@@ -18,4 +18,4 @@ Host {{ bastion_ip }} ...@@ -18,4 +18,4 @@ Host {{ bastion_ip }}
Host {{ vars['hosts'] }} Host {{ vars['hosts'] }}
ProxyCommand ssh -W %h:%p {{ real_user }}@{{ bastion_ip }} ProxyCommand ssh -W %h:%p {{ real_user }}@{{ bastion_ip }}
StrictHostKeyChecking no StrictHostKeyChecking no
{% endif %} {% endif %}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment