- name: add ssh keys ansible.posix.authorized_key: user: "{{ ansible_user }}" state: present # copy file present on the controller to the remote host # https://docs.ansible.com/ansible/latest/collections/ansible/builtin/copy_module.html key: "{{ lookup('file', '~/.ssh/default.pub') }}"