--- - name: Add ssh public key to hosts hosts: all # vars: tasks: - name: add keys ansible.posix.authorized_key: user: aleidk state: present key: '{{ lookup("file", "~/.ssh/id_ed25519.pub") }}'