1
0
Fork 0
mirror of https://github.com/roles-ansible/ansible_role_restic.git synced 2024-12-11 23:41:32 +01:00

Merge pull request #116 from beechesII/main

added new variable restic_backup_script_shell
This commit is contained in:
L3D 2024-02-08 11:56:26 +01:00 committed by GitHub
commit 99381ad1c7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 3 additions and 1 deletions

View file

@ -72,6 +72,7 @@ ansible-galaxy install roles-ansible.restic
| `restic_download_path` | `'/opt/restic'` | Download location for the restic binary |
| `restic_install_path` | `'/usr/local/bin'` | Install location for the restic binary |
| `restic_script_dir` | `'/opt/restic'` | Location of the generated backup scripts |
| `restic_backup_script_shell` | `sh` | Shell to use for run of backup script |
| `restic_log_dir` | `'{{ restic_script_dir }}/log'` | Location of the logs of the backup scripts |
| `restic_repos` | `{}` | A dictionary of repositories where snapshots are stored. *(More Info: [Repos](#Repos))* |
| `restic_backups` | `{}` (or `[]`) | A list of dictionaries specifying the files and directories to be backed up *(More Infos: [Backups](#Backups))* |

View file

@ -4,6 +4,7 @@ restic_version: '0.16.3'
restic_download_path: '/opt/restic'
restic_install_path: '/usr/local/bin'
restic_script_dir: '/opt/restic'
restic_backup_script_shell: sh
restic_log_dir: '{{ restic_script_dir }}/log'
restic_repos: {}
restic_backups: []

View file

@ -1,7 +1,7 @@
---
- name: (RUN BACKUP) Run backup script
ansible.builtin.command:
cmd: "/usr/bin/env sh {{ restic_script_dir }}/backup-{{ item.name | replace(' ', '') }}.sh"
cmd: "/usr/bin/env {{ restic_backup_script_shell }} {{ restic_script_dir }}/backup-{{ item.name | replace(' ', '') }}.sh"
no_log: "{{ restic_no_log }}"
with_items: '{{ restic_backups }}'
when: