Files
Watari-Ansible/playbooks/setup-restic.yml
2026-07-28 06:32:32 +00:00

33 lines
878 B
YAML

- 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
ansible.builtin.copy:
dest: /home/restic/.ssh/resticuser.ed25519
content: "{{ restic_private }}"
owner: restic
group: users
mode: '0600'
- name: Copy Restic Repo Pass
ansible.builtin.copy:
dest: /home/restic/.resticpassword
content: "{{ restic_repopass }}"
owner: restic
group: users
mode: '0600'