From 7ebad0a8164345ebf6b93b028ae7ef3b56ecabf4 Mon Sep 17 00:00:00 2001 From: Michal Jagiello Date: Wed, 2 Nov 2022 07:24:28 +0000 Subject: Release oom-automatic-installation Issue-ID: INT-2150 Signed-off-by: Michal Jagiello Change-Id: I8992f93e2b79f17c90d8f3c350891e8428ef3dcb --- scripts/ssh_prepare/templates/config.j2 | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 scripts/ssh_prepare/templates/config.j2 (limited to 'scripts/ssh_prepare/templates/config.j2') diff --git a/scripts/ssh_prepare/templates/config.j2 b/scripts/ssh_prepare/templates/config.j2 new file mode 100644 index 0000000..375efd7 --- /dev/null +++ b/scripts/ssh_prepare/templates/config.j2 @@ -0,0 +1,33 @@ +Host * +{% if creds_stat.stat.exists %} + IdentityFile {{ base_dir }}/id_rsa +{% endif %} + UserKnownHostsFile=/dev/null + StrictHostKeyChecking=no + +{% if gw_stat.stat.exists %} +{% for gw in ssh_gateways | default([]) %} +host {{ gw.name }} + Hostname {{ gw.public_fqdn | default(gw.ansible_host) }} + User {{ gw.ansible_user }} +{% if gw.ansible_port is defined %} + Port {{ gw.ansible_port }} +{% endif %} +{% if gw.proxy_command is defined %} + ProxyCommand {{ gw.proxy_command }} +{% endif %} + +{% endfor %} +{% endif %} + +{% for node in groups.all %} +{% if hostvars[node].ansible_host is defined %} +host {{ node }} {{ hostvars[node].public_fqdn | default('') }} {{ hostvars[node].ansible_host }} + Hostname {{ hostvars[node].public_fqdn | default(hostvars[node].ansible_host) }} + User {{ hostvars[node].ansible_user }} +{% if gw_stat.stat.exists %} + ProxyCommand ssh -F {{ base_dir }}/ssh_config -W %h:%p {{ ssh_gateways[0].name }} +{% endif %} +{% endif %} + +{% endfor %} -- cgit 1.2.3-korg