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