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