--- - name: template ssh private key become: true ansible.builtin.template: src: private_key.j2 dest: "/etc/rsync_mirror/.ssh/id_rsync_mirror" owner: "{{ rsync_mirror_user }}" group: "{{ rsync_mirror_user_group }}" mode: "0400" no_log: true when: - rsync_mirror_syncoid_destination_host - name: template ssh public key ansible.posix.authorized_key: user: "{{ rsync_mirror_user }}" key: "{{ rsync_mirror_syncoid_ssh_pubkey }}"