ansible_role_restic/tasks/install.yml
Matthias Leutenegger 06b7ab9b36 restructure
2019-08-15 13:07:53 +02:00

34 lines
1.1 KiB
YAML

---
- name: Set restic_url
set_fact:
restic_url: '{{ restic_url_r }}{{ restic_url_v }}{{ restic_file }}'
when: restic_url is not defined
- name: Download client binary
get_url:
url: '{{ restic_url }}'
dest: '{{ restic_download_path }}/restic.bz2'
force: true
register: get_url_restic
# TODO: This needs to become independent of the shell module to actually work
# on every system. We could use a distribution specific aproach, but this would
# conflict with the current structure in tasks/distribution/
- name: Decompress the binary
shell: "bzip2 -dc {{ get_url_restic.dest }} > {{ restic_bin_bath }}"
args:
creates: '{{ restic_download_path }}/bin/restic-{{ restic_version }}'
- name: Ensure permissions are correct
file:
path: '{{ restic_download_path }}/bin/restic-{{ restic_version }}'
mode: '0755'
owner: '{{ restic_dir_owner }}'
group: '{{ restic_dir_group }}'
- name: Create symbolic link to the correct version
file:
src: '{{ restic_download_path }}/bin/restic-{{ restic_version }}'
path: '{{ restic_install_path }}/restic'
state: link
force: true