--- - hosts: all tasks: - name: get fingerprints fetch: src={{ item.src }} dest={{ item.dest }} flat=yes with_items: - { src: '/etc/ssh/ssh_host_rsa_key.pub', dest: 'fingerprints/{{ ansible_hostname }}_rsa.pub' } - { src: '/etc/ssh/ssh_host_ed25519_key.pub', dest: 'fingerprints/{{ ansible_hostname }}_ed25519.pub' }