ansible: first proposl for nicer inventory names
[noc.git] / ansible / roles / localconfig / templates / ssh / 10r3.conf.j2
1 ##########################################################################################
2 # realraum ssh-config (generated by ansible NOC repo)
3
4 #######################################
5 ### dynamically generated host configs
6
7 {% for host in (groups['all'] | sort) %}
8 Host {{ hostvars[host].ansible_host }} r3-{{ host }} r3g-{{ host }} r3e-{{ host }}
9     Hostname {{ hostvars[host].ansible_host }}
10 {% if 'localconfig_ssh_config_proxycommand' in hostvars[host] %}
11     ProxyCommand {{ hostvars[host].localconfig_ssh_config_proxycommand }}
12 {% endif %}
13 {% if 'localconfig_ssh_config_user' in hostvars[host] %}
14     User {{ hostvars[host].localconfig_ssh_config_user }}
15 {% endif %}
16 {% if 'localconfig_ssh_config_port' in hostvars[host] %}
17     Port {{ hostvars[host].localconfig_ssh_config_port }}
18 {% endif %}
19
20 {% endfor %}
21 #######################################
22 ### static host configs
23
24 Host gw.realraum.at r3-gw
25     Hostname gw.realraum.at
26
27 Host gnocchi1.realraum.at r3-gnocchi1
28     Hostname gnocchi1.realraum.at
29
30 Host gnocchi2.realraum.at r3-gnocchi2
31     Hostname gnocchi2.realraum.at
32
33 Host torwaechter.mgmt.realraum.at r3g-torwaechter
34     Hostname torwaechter.mgmt.realraum.at
35     User realraum
36
37 Host ap0.mgmt.realraum.at r3g-ap0
38     Hostname ap0.mgmt.realraum.at
39     User root
40
41 Host ap1.mgmt.realraum.at r3g-ap1
42     Hostname ap1.mgmt.realraum.at
43     User root
44
45 Host licht.realraum.at r3-licht r3g-licht r3e-licht
46     Hostname licht.realraum.at
47     User realraum
48
49
50 #############################################################
51 ###
52 ### general settings, this must come after the last host entry!!!
53 ###
54
55 ## use gateway as jump host
56 Host r3g-*
57 #    ProxyCommand ssh -q -a gw.realraum.at -W %h:%p
58     ProxyCommand ssh -q -a gw.realraum.at nc -q0 -w1 %h %p
59
60 ## use entrance as jump host
61 Host r3e-*
62     ProxyCommand ssh -q -a entrance.realraum.at -W %h:%p
63
64 Host r3-* r3g-* r3e-* *.realraum.at
65 {% for id_file in localconfig_ssh_ids %}
66     IdentityFile {{ id_file }}
67 {% endfor %}
68     IdentitiesOnly yes
69     ForwardAgent no
70     Port 22000
71 {% if localconfig_ssh_user is defined %}
72     User {{ localconfig_ssh_user }}
73 {% endif %}
74
75 ###
76 ### don't put anything beyond this line!