generated from ansible/ansible_template
only install restic if not present
This commit is contained in:
parent
7686ddffeb
commit
8921e437ac
|
@ -1,10 +1,19 @@
|
||||||
|
- name: "Try to update restic"
|
||||||
|
command: "restic self-update"
|
||||||
|
register: restic_update
|
||||||
|
ignore_errors: true
|
||||||
|
|
||||||
- name: "Download restic"
|
- name: "Download restic"
|
||||||
get_url:
|
get_url:
|
||||||
url: "{{ restic_url }}"
|
url: "{{ restic_url }}"
|
||||||
dest: /tmp/restic.bz2
|
dest: /tmp/restic.bz2
|
||||||
|
register: restic_download
|
||||||
|
when: restic_update is failed
|
||||||
|
|
||||||
- name: "Extract restic"
|
- name: "Extract restic"
|
||||||
command: "bzip2 -df /tmp/restic.bz2"
|
command: "bzip2 -df /tmp/restic.bz2"
|
||||||
|
register: restic_extract
|
||||||
|
when: restic_download is changed
|
||||||
|
|
||||||
- name: "Install restic"
|
- name: "Install restic"
|
||||||
copy:
|
copy:
|
||||||
|
@ -12,6 +21,7 @@
|
||||||
dest: "/usr/bin/restic"
|
dest: "/usr/bin/restic"
|
||||||
remote_src: yes
|
remote_src: yes
|
||||||
mode: "751"
|
mode: "751"
|
||||||
|
when: restic_extract is changed
|
||||||
|
|
||||||
- name: "Create the restic config dir"
|
- name: "Create the restic config dir"
|
||||||
file:
|
file:
|
||||||
|
|
Reference in New Issue