From 2f1958d50d256662b562403bb5db72016e2bd9e3 Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Tue, 8 Aug 2023 16:41:58 -0400 Subject: [PATCH] Work around SSH key bug --- roles/base/templates/etc/ssh/ssh_known_hosts.j2 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/roles/base/templates/etc/ssh/ssh_known_hosts.j2 b/roles/base/templates/etc/ssh/ssh_known_hosts.j2 index b17201d..b773dd3 100644 --- a/roles/base/templates/etc/ssh/ssh_known_hosts.j2 +++ b/roles/base/templates/etc/ssh/ssh_known_hosts.j2 @@ -2,5 +2,7 @@ # {{ ansible_managed }} {% for host in groups[cluster_group] %} +{% if hostvars[host].ansible_ssh_host_key_ed25519_public is defined %} {{ host }},{{ host.split('.')[0] }}.{{ networks['cluster']['domain'] }},{{ host.split('.')[0] }} ssh-ed25519 {{ hostvars[host].ansible_ssh_host_key_ed25519_public }} +{% endif %} {% endfor %}