1
0
forked from finallycoffee/base

feat(restic): Use RESTIC_PASSWORD_FILE instead of RESTIC_PASSWORD

This commit is contained in:
2026-02-03 11:46:57 +01:00
parent 153df81836
commit cfc09bb48f
3 changed files with 31 additions and 1 deletions

View File

@@ -6,6 +6,23 @@
state: present
system: true
when: restic_create_user
register: restic_user_res
- name: Ensure base directory for restic is created
ansible.builtin.file:
path: "{{ restic_base_path }}"
state: directory
owner: "{{ restic_user_res.uid | default(root) }}"
group: "{{ restic_user_res.group | default(root) }}"
mode: "0755"
- name: Ensure credentials directory for restic is created
ansible.builtin.file:
path: "{{ resitc_credentials_base_path }}"
state: directory
owner: "{{ restic_user_res.uid | default(root) }}"
group: "{{ restic_user_res.group | default(root) }}"
mode: "0700"
- name: Ensure either backup_paths or backup_stdin_command is populated
when: restic_backup_paths|length > 0 and restic_backup_stdin_command and false
@@ -42,6 +59,14 @@
state: present
when: ansible_os_family not in ['RedHat', 'Debian']
- name: Ensure restic password file is created and uptodate
copy:
dest: "{{ restic_password_file_path }}"
mode: "{{ restic_password_file_mode }}"
owner: "{{ restic_user_res.uid | default(root) }}"
group: "{{ restic_user_res.group | default(root) }}"
content: "{{ restic_repo_password }}"
- name: Ensure systemd service file for '{{ restic_job_name }}' is templated
template:
dest: "/etc/systemd/system/{{ restic_systemd_unit_naming_scheme }}.service"