ansible: first proposl for nicer inventory names
[noc.git] / ansible / roles / localconfig / templates / ssh / 10r3.conf.j2
index ba11160..dd33944 100644 (file)
@@ -2,12 +2,11 @@
 # realraum ssh-config (generated by ansible NOC repo)
 
 #######################################
-### dynamically generated hosts
+### dynamically generated host configs
 
 {% for host in (groups['all'] | sort) %}
-{% set shortname = (host.split('.') | first) %}
-Host {{ host }}.realraum.at r3-{{ shortname }} r3g-{{ shortname }} r3e-{{ shortname }}
-    Hostname {{ host }}.realraum.at
+Host {{ hostvars[host].ansible_host }} r3-{{ host }} r3g-{{ host }} r3e-{{ host }}
+    Hostname {{ hostvars[host].ansible_host }}
 {% if 'localconfig_ssh_config_proxycommand' in hostvars[host] %}
     ProxyCommand {{ hostvars[host].localconfig_ssh_config_proxycommand }}
 {% endif %}