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 #52 from roles-ansible/cache

optional cache directory
This commit is contained in:
L3D 2022-01-18 18:05:10 +01:00 committed by GitHub
commit dd5672f99d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 4 deletions

View file

@ -79,6 +79,8 @@ ansible-galaxy install arillso.restic
| `restic_dir_group` | `'{{ansible_user}}'` | The group of all created dirs | | `restic_dir_group` | `'{{ansible_user}}'` | The group of all created dirs |
| `restic_no_log` | `true` | set to false to see hidden ansible logs | | `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_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 ### Repos
Restic stores data in repositories. You have to specify at least one repository Restic stores data in repositories. You have to specify at least one repository

View file

@ -24,5 +24,9 @@ restic_systemd_timer_default_OnCalendar: '*-*-* 02:00:00'
submodules_versioncheck: false submodules_versioncheck: false
restic_do_not_cleanup_cron: 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 # outdated variables because of irritating names, but kept for compatibility
restic_create_cron: false restic_create_cron: false

View file

@ -23,8 +23,6 @@ fi
# your normal workflow here... # your normal workflow here...
{% if item.disable_logging is defined and item.disable_logging %} {% if item.disable_logging is defined and item.disable_logging %}
{% set backup_result_log, backup_output_log = "/dev/null", "/dev/null" %} {% set backup_result_log, backup_output_log = "/dev/null", "/dev/null" %}
{% set forget_result_log, forget_output_log = "/dev/null", "/dev/null" %} {% set forget_result_log, forget_output_log = "/dev/null", "/dev/null" %}
@ -38,6 +36,10 @@ fi
{% endif %} {% endif %}
{% 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_REPOSITORY={{ restic_repos[item.repo].location }}
export RESTIC_PASSWORD='{{ restic_repos[item.repo].password | regex_replace('\'', '\'\\\'\'') }}' export RESTIC_PASSWORD='{{ restic_repos[item.repo].password | regex_replace('\'', '\'\\\'\'') }}'
BACKUP_NAME={{ item.name }} BACKUP_NAME={{ item.name }}

View file

@ -10,5 +10,5 @@ restic_os_variables:
paths: paths:
- 'vars' - 'vars'
playbook_version_number: 22 # should be int playbook_version_number: 23 # should be int
playbook_version_path: 'do1jlr.restic.version' playbook_version_path: 'do1jlr.restic.version'