mirror of
https://github.com/roles-ansible/ansible_role_restic.git
synced 2024-12-11 23:41:32 +01:00
optional cache directory
This commit is contained in:
parent
3e39c9200d
commit
d30e30fcae
4 changed files with 12 additions and 4 deletions
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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 }}
|
||||||
|
|
|
@ -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'
|
||||||
|
|
Loading…
Reference in a new issue