Merge PR#36: fix ssh config after merging gnocci/setup
[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 hostvars[host].ansible_port != 22000 %}
17     Port {{ hostvars[host].ansible_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 ap0.mgmt.realraum.at r3g-ap0
28     Hostname ap0.mgmt.realraum.at
29     User root
30
31 Host ap1.mgmt.realraum.at r3g-ap1
32     Hostname ap1.mgmt.realraum.at
33     User root
34
35 Host ap2.mgmt.realraum.at r3g-ap2
36     Hostname ap2.mgmt.realraum.at
37     User root
38
39 Host licht.realraum.at r3-licht r3g-licht r3e-licht
40     Hostname licht.realraum.at
41     User realraum
42
43
44 #############################################################
45 ###
46 ### general settings, this must come after the last host entry!!!
47 ###
48
49 ## use gateway as jump host
50 Host r3g-*
51 #    ProxyCommand ssh -q -a gw.realraum.at -W %h:%p
52     ProxyCommand ssh -q -a gw.realraum.at nc -q0 -w1 %h %p
53
54 ## use entrance as jump host
55 Host r3e-*
56     ProxyCommand ssh -q -a entrance.realraum.at -W %h:%p
57
58 Host r3-* r3g-* r3e-* *.realraum.at
59 {% for id_file in localconfig_ssh_ids %}
60     IdentityFile {{ id_file }}
61 {% endfor %}
62     IdentitiesOnly yes
63     ForwardAgent no
64     Port 22000
65 {% if localconfig_ssh_user is defined %}
66     User {{ localconfig_ssh_user }}
67 {% endif %}
68
69 ###
70 ### don't put anything beyond this line!