mirror of
https://github.com/roles-ansible/ansible_role_restic/
synced 2026-09-05 19:27:05 +02:00
commit
a0414e3f07
3 changed files with 14 additions and 2 deletions
|
|
@ -69,7 +69,7 @@ ansible-galaxy install roles-ansible.restic
|
|||
| Name | Default | Description |
|
||||
|-------------------------------|---------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `restic_url` | `undefined` | The URL to download restic from. Use this variable to overwrite the default |
|
||||
| `restic_version` | `'0.15.1'` | The version of Restic to install |
|
||||
| `restic_version` | `'0.18.1'` | The version of Restic to install. Set to `'latest'` to automatically fetch and install the newest release from GitHub. |
|
||||
| `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 |
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
restic_url: '{{ restic_url_default }}'
|
||||
restic_version: '0.16.3'
|
||||
restic_version: '0.16.3' # set to 'latest' to automatically fetch the newest release
|
||||
restic_download_path: '/opt/restic'
|
||||
restic_install_path: '/usr/local/bin'
|
||||
restic_script_dir: '/opt/restic'
|
||||
|
|
|
|||
|
|
@ -1,4 +1,16 @@
|
|||
---
|
||||
- name: (PREPARE) Fetch latest restic version from GitHub API
|
||||
ansible.builtin.uri:
|
||||
url: 'https://api.github.com/repos/restic/restic/releases/latest'
|
||||
return_content: true
|
||||
register: restic_latest_release
|
||||
when: restic_version == 'latest'
|
||||
|
||||
- name: (PREPARE) Set restic_version to latest release
|
||||
ansible.builtin.set_fact:
|
||||
restic_version: '{{ restic_latest_release.json.tag_name | regex_replace("^v", "") }}'
|
||||
when: restic_version == 'latest'
|
||||
|
||||
- name: (PREPARE) Ensure restic directories exist
|
||||
become: true
|
||||
ansible.builtin.file:
|
||||
|
|
|
|||
Loading…
Reference in a new issue