From 94b12794dcd1bf1cbb76add36d31b3db0310f2bb Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Fri, 1 Sep 2023 15:42:29 -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 %}