--- - name: Ensure cit user hosts: all roles: - cit_user - name: Set the authorized_keys of the cit user to the authorized_keys of the root user hosts: all tasks: - name: Ensure cit user .ssh directory ansible.builtin.file: path: /home/cit/.ssh state: directory owner: cit group: cit mode: "0700" - name: Copy the root users authorized_keys for the cit user ansible.builtin.copy: src: /root/.ssh/authorized_keys remote_src: true dest: /home/cit/.ssh/authorized_keys owner: cit group: cit mode: "0600"