role.ssh-hostkeys/tasks/main.yml

15 lines
324 B
YAML
Raw Normal View History

2024-11-11 09:31:13 +00:00
---
- name: Sanity check
assert:
that:
- ssh_hostkeys|length > 0
- ansible_user_id == 'root'
- name: Add global known hosts fingerprints for SSH
known_hosts:
path: '{{ ssh_hostkeys_file }}'
name: '{{ item.split(" ")[0] }}'
hash_host: false
key: '{{ item }}'
loop: '{{ ssh_hostkeys }}'