restic rest server configuration
This commit is contained in:
parent
fcd36a1035
commit
5f4d69ff17
7 changed files with 136 additions and 55 deletions
|
|
@ -1,24 +1,24 @@
|
|||
---
|
||||
- name: Ensure download directory is present
|
||||
ansible.builtin.file:
|
||||
path: "/home/debian/restic-{{ restic_version }}"
|
||||
path: "/opt/restic-{{ restic_version }}"
|
||||
state: directory
|
||||
mode: '0755'
|
||||
|
||||
- name: Ensure compressed binary is downloaded
|
||||
ansible.builtin.get_url:
|
||||
url: "https://github.com/restic/restic/releases/download/v{{ restic_version }}/restic_{{ restic_version }}_linux_arm64.bz2"
|
||||
dest: "/home/debian/restic-{{ restic_version }}/restic-{{ restic_version }}.bz2"
|
||||
dest: "/opt/restic-{{ restic_version }}/restic-{{ restic_version }}.bz2"
|
||||
register: res
|
||||
|
||||
- name: Ensure binary is decompressed
|
||||
ansible.builtin.shell:
|
||||
cmd: "bunzip2 -k /home/debian/restic-{{ restic_version }}/restic-{{ restic_version }}.bz2"
|
||||
cmd: "bunzip2 -k /opt/restic-{{ restic_version }}/restic-{{ restic_version }}.bz2"
|
||||
when: 'res.changed'
|
||||
|
||||
- name: Ensure binary is copied to correct location
|
||||
ansible.builtin.copy:
|
||||
src: "/home/debian/restic-{{ restic_version }}/restic-{{ restic_version }}"
|
||||
src: "/opt/restic-{{ restic_version }}/restic-{{ restic_version }}"
|
||||
remote_src: true
|
||||
dest: '/usr/local/bin/restic'
|
||||
owner: 'root'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue