Skip to content
Snippets Groups Projects
Commit bc3597b4 authored by Lars Beckers's avatar Lars Beckers
Browse files

hostkey-provider: readd check for existing facts

parent a0fdcb28
Branches
No related tags found
No related merge requests found
......@@ -4,14 +4,14 @@
{{ v['ansible_host'] }},{{ v['ansible_all_ipv4_addresses']|join(',') }},{{ v['ansible_all_ipv6_addresses']|join(',') }} ssh-ed25519 {{ v['ansible_ssh_host_key_ed25519_public'] }}
{{ v['ansible_host'] }},{{ v['ansible_all_ipv4_addresses']|join(',') }},{{ v['ansible_all_ipv6_addresses']|join(',') }} ssh-rsa {{ v['ansible_ssh_host_key_rsa_public'] }}
{%- else -%}
{%- if 'ansible_local' in hostvars[hostkeys_collector] and 'hostkeys_' ~ v['ansible_host'] in hostvars[hostkeys_collector]['ansible_local'] -%}
#}
{%- if 'ansible_local' in hostvars[hostkeys_collector] and 'hostkeys_' ~ v['ansible_host'] in hostvars[hostkeys_collector]['ansible_local'] %}
{%- set c = hostvars[hostkeys_collector]['ansible_local']['hostkeys_'~ v['ansible_host']]['collected'] -%}
{{ v['ansible_host'] }},{{ c['ipv4'] }},{{ c['ipv6'] }} ssh-ed25519 {{ c['ed25519'] }}
{{ v['ansible_host'] }},{{ c['ipv4'] }},{{ c['ipv6'] }} ssh-rsa {{ c['rsa'] }}
{% endif -%}
{#
{%- endif -%}
{%- endif -%}
#}
{% endfor -%}
{{ lookup('file', known_hosts) }}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment