mirror of
https://github.com/roles-ansible/ansible_role_restic.git
synced 2024-12-11 23:41:32 +01:00
Merge pull request #52 from roles-ansible/cache
optional cache directory
This commit is contained in:
commit
dd5672f99d
4 changed files with 12 additions and 4 deletions
|
@ -69,7 +69,7 @@ ansible-galaxy install arillso.restic
|
|||
| `restic_version` | `'0.12.1'` | The version of Restic to install |
|
||||
| `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_script_dir` | `'/opt/restic'` | Location of the generated 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_backups` | `{}` (or `[]`) | A list of dictionaries specifying the files and directories to be backed up *(More Infos: [Backups](#Backups))* |
|
||||
|
@ -79,6 +79,8 @@ ansible-galaxy install arillso.restic
|
|||
| `restic_dir_group` | `'{{ansible_user}}'` | The group of all created dirs |
|
||||
| `restic_no_log` | `true` | set to false to see hidden ansible logs |
|
||||
| `restic_do_not_cleanup_cron ` | `false` | we changed the cron location and clean up the old one. You can skip the cleanup here |
|
||||
| `restic__cache_config` | `false` | configure custom cache directory |
|
||||
| `restic__cache_dir` | `'~/.cache/restic'` | define custom cache directory |
|
||||
|
||||
### Repos
|
||||
Restic stores data in repositories. You have to specify at least one repository
|
||||
|
|
|
@ -24,5 +24,9 @@ restic_systemd_timer_default_OnCalendar: '*-*-* 02:00:00'
|
|||
submodules_versioncheck: false
|
||||
restic_do_not_cleanup_cron: false
|
||||
|
||||
# cache
|
||||
restic__cache_config: false
|
||||
restic__cache_dir: '~/.cache/restic'
|
||||
|
||||
# outdated variables because of irritating names, but kept for compatibility
|
||||
restic_create_cron: false
|
||||
|
|
|
@ -23,8 +23,6 @@ fi
|
|||
# your normal workflow here...
|
||||
|
||||
|
||||
|
||||
|
||||
{% if item.disable_logging is defined and item.disable_logging %}
|
||||
{% set backup_result_log, backup_output_log = "/dev/null", "/dev/null" %}
|
||||
{% set forget_result_log, forget_output_log = "/dev/null", "/dev/null" %}
|
||||
|
@ -38,6 +36,10 @@ fi
|
|||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% if restic__cache_config | bool -%}
|
||||
export XDG_CACHE_HOME={{ restic__cache_dir }}
|
||||
{% endif %}
|
||||
|
||||
export RESTIC_REPOSITORY={{ restic_repos[item.repo].location }}
|
||||
export RESTIC_PASSWORD='{{ restic_repos[item.repo].password | regex_replace('\'', '\'\\\'\'') }}'
|
||||
BACKUP_NAME={{ item.name }}
|
||||
|
|
|
@ -10,5 +10,5 @@ restic_os_variables:
|
|||
paths:
|
||||
- 'vars'
|
||||
|
||||
playbook_version_number: 22 # should be int
|
||||
playbook_version_number: 23 # should be int
|
||||
playbook_version_path: 'do1jlr.restic.version'
|
||||
|
|
Loading…
Reference in a new issue