summaryrefslogtreecommitdiffstats
path: root/roles/static_inventory/templates/openstack_ssh_config.j2
blob: ad5d1253aa5123e1d7a46fa5f8f127e73de9d9fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Host *
    IdentitiesOnly yes

Host bastion
    Hostname {{ hostvars['bastion'].ansible_host }}
    IdentityFile {{ hostvars['bastion'].ansible_private_key_file }}
    User {{ ssh_user }}
    StrictHostKeyChecking no
    UserKnownHostsFile=/dev/null

{% for host in groups['all'] | difference(groups['bastions'][0]) %}

Host {{ host }}
    Hostname {{ hostvars[host].ansible_host }}
    ProxyCommand {{ ssh_proxy_command  }} -W {{ hostvars[host].private_v4 }}:22
    IdentityFile {{ hostvars[host].ansible_private_key_file }}
    User {{ ssh_user }}
    StrictHostKeyChecking no
    UserKnownHostsFile=/dev/null

{% endfor %}