--- - hosts: ubuntu,debian,raspberry tasks: - name: Deploy Ansible SSH-Key authorized_key: user: root key: "{{ lookup('file', '/root/.ssh/id_rsa.pub') }}" path: /root/.ssh/authorized_keys state: present