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

added new variable restic_backup_script_shell, to make shell to use for backup script configurable

This commit is contained in:
beechesII 2024-02-08 11:39:05 +01:00
parent 64ce64c665
commit 14126768fd
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_download_path` | `'/opt/restic'` | Download location for the restic binary |
| `restic_install_path` | `'/usr/local/bin'` | Install 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_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_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_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))* | | `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_download_path: '/opt/restic'
restic_install_path: '/usr/local/bin' restic_install_path: '/usr/local/bin'
restic_script_dir: '/opt/restic' restic_script_dir: '/opt/restic'
restic_backup_script_shell: sh
restic_log_dir: '{{ restic_script_dir }}/log' restic_log_dir: '{{ restic_script_dir }}/log'
restic_repos: {} restic_repos: {}
restic_backups: [] restic_backups: []

View file

@ -1,7 +1,7 @@
--- ---
- name: (RUN BACKUP) Run backup script - name: (RUN BACKUP) Run backup script
ansible.builtin.command: 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 }}" no_log: "{{ restic_no_log }}"
with_items: '{{ restic_backups }}' with_items: '{{ restic_backups }}'
when: when: