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