ansible-restic/tasks/install.yml
Christian Scheb fd989a95b1
Fix restic download links (#10)
Co-authored-by: Christian Scheb <christian.scheb@stackfuel.com>
2024-02-20 18:28:36 +01:00

35 lines
1.4 KiB
YAML

---
- name: Install fuse (to mount repositories)
ansible.builtin.apt:
name: fuse
- name: Install bzip2 (to install restic)
ansible.builtin.apt:
name: bzip2
- name: Install pigz (to compress db dumps)
ansible.builtin.apt:
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