ansible-collection-base/playbooks/known_hosts.yml

15 lines
358 B
YAML
Raw Permalink Normal View History

---
- name: 'Install SSH keys as known hosts'
hosts: 'all'
serial: 1
gather_facts: false
tasks:
- name: 'Register host key'
delegate_to: 'localhost'
throttle: 1
when: 'ssh_ed25519'
ansible.builtin.known_hosts:
name: '{{ inventory_hostname }}'
key: '{{ inventory_hostname }} ssh-ed25519 {{ ssh_ed25519 }}'