--- - name: Copy sshd_config ansible.builtin.template: src: templates/ssh/sshd_config dest: /etc/ssh/sshd_config mode: "644" notify: - Restart sshd become: true - name: Copy pubkey ansible.builtin.copy: content: "{{ pubkey }}" dest: "/home/{{ user }}/.ssh/authorized_keys" owner: "{{ user }}" group: "{{ user }}" mode: "644"