2021-04-29 16:16:35 +02:00
|
|
|
---
|
2022-01-10 14:19:53 +01:00
|
|
|
- name: (BACKUP) reformat dict if necessary
|
2022-04-01 11:07:12 +02:00
|
|
|
ansible.builtin.set_fact:
|
2024-04-04 13:27:05 +02:00
|
|
|
restic_backups: "{{ restic_backups | default([]) | map('extract', restic_backups) | list }}"
|
2021-04-29 16:16:35 +02:00
|
|
|
when:
|
|
|
|
- restic_backups | type_debug == "dict"
|
|
|
|
|
2022-01-10 14:19:53 +01:00
|
|
|
- name: (BACKUP) Create backup credentials
|
2022-04-01 11:07:12 +02:00
|
|
|
ansible.builtin.template:
|
2021-04-29 16:16:35 +02:00
|
|
|
src: restic_access_Linux.j2
|
|
|
|
dest: "{{ restic_script_dir }}/access-{{ item.name | replace(' ', '') }}.sh"
|
|
|
|
mode: '0700'
|
|
|
|
owner: '{{ restic_dir_owner }}'
|
|
|
|
group: '{{ restic_dir_group }}'
|
2021-08-03 23:16:34 +02:00
|
|
|
no_log: "{{ restic_no_log }}"
|
2021-04-29 16:16:35 +02:00
|
|
|
with_items: '{{ restic_backups }}'
|
|
|
|
when:
|
|
|
|
- item.name is defined
|
|
|
|
- item.src is defined or item.stdin is defined
|
|
|
|
- item.src is defined or item.stdin and item.stdin_cmd is defined
|
|
|
|
- item.repo in restic_repos
|
|
|
|
|
2022-01-10 14:19:53 +01:00
|
|
|
- name: (BACKUP) Create backup script
|
2022-04-01 11:07:12 +02:00
|
|
|
ansible.builtin.template:
|
2021-04-29 16:16:35 +02:00
|
|
|
src: restic_script_Linux.j2
|
|
|
|
dest: "{{ restic_script_dir }}/backup-{{ item.name | replace(' ', '') }}.sh"
|
|
|
|
mode: '0700'
|
|
|
|
owner: '{{ restic_dir_owner }}'
|
|
|
|
group: '{{ restic_dir_group }}'
|
2021-08-03 23:16:34 +02:00
|
|
|
no_log: "{{ restic_no_log }}"
|
2021-04-29 16:16:35 +02:00
|
|
|
with_items: '{{ restic_backups }}'
|
|
|
|
when:
|
|
|
|
- item.name is defined
|
|
|
|
- item.src is defined or item.stdin is defined
|
|
|
|
- item.src is defined or item.stdin and item.stdin_cmd is defined
|
|
|
|
- item.repo in restic_repos
|