Browse Source

only add hostname if external_ip is defined

systemd-xsession
parent
commit
8c82dbf3e4
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      templates/ssh.config.j2

+ 2
- 0
templates/ssh.config.j2 View File

@@ -1,4 +1,6 @@
{% for hostname in groups.vms %}
Host {{hostname}}
{% if 'external_ip' in hostvars[hostname] %}
HostName {{hostvars[hostname].external_ip}}
{% endif %}
{% endfor %}