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 %}