- name: Create Restic user user: name: restic uid: 2001 group: users state: present create_home: yes home: /home/restic shell: /bin/bash - name: Add Authorized key for Restic user ansible.posix.authorized_key: user: restic state: present key: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOsDIrV6QIMtpJFNpZEgHnkYgFC6OXMJQFc1JqrnpCzY fake@gmail.com" - name: Install Restic Private key copy: dest: /home/restic/.ssh/resticuser.ed25519 content: "{{ restic_private }}" owner: restic group: users mode: '0600' - name: Copy Restic Repo Pass copy: dest: /home/restic/.resticpassword content: "{{ restic_repopass }}" owner: restic group: users mode: '0600'