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