35 lines
1.4 KiB
YAML
35 lines
1.4 KiB
YAML
---
|
|
- name: Install fuse (to mount repositories)
|
|
ansible.builtin.package:
|
|
name: fuse
|
|
|
|
- name: Install bzip2 (to install restic)
|
|
ansible.builtin.package:
|
|
name: bzip2
|
|
|
|
- name: Install pigz (to compress db dumps)
|
|
ansible.builtin.package:
|
|
name: pigz
|
|
|
|
- name: Download restic
|
|
ansible.builtin.get_url:
|
|
url: "https://github.com/restic/restic/releases/download/v{{ restic_version }}/restic_{{ restic_version }}_linux_{{ restic_arch_map[ansible_architecture] | default(ansible_architecture) }}.bz2"
|
|
dest: "/tmp/restic_{{ restic_version }}_linux_{{ restic_arch_map[ansible_architecture] | default(ansible_architecture) }}.bz2"
|
|
mode: "0644"
|
|
|
|
- name: Extract restic
|
|
ansible.builtin.command: "bzip2 -d /tmp/restic_{{ restic_version }}_linux_{{ restic_arch_map[ansible_architecture] | default(ansible_architecture) }}.bz2"
|
|
args:
|
|
creates: "/tmp/restic_{{ restic_version }}_linux_{{ restic_arch_map[ansible_architecture] | default(ansible_architecture) }}"
|
|
|
|
- name: Install restic
|
|
ansible.builtin.copy:
|
|
remote_src: true
|
|
src: "/tmp/restic_{{ restic_version }}_linux_{{ restic_arch_map[ansible_architecture] | default(ansible_architecture) }}"
|
|
dest: "{{ restic_path }}"
|
|
mode: "0755"
|
|
|
|
- name: Remove downloaded file
|
|
ansible.builtin.file:
|
|
path: "/tmp/restic_{{ restic_version }}_linux_{{ restic_arch_map[ansible_architecture] | default(ansible_architecture) }}"
|
|
state: absent
|