diff --git a/tasks/distribution/Linux.yml b/tasks/distribution/Linux.yml index cecc5d2..f4a58d3 100644 --- a/tasks/distribution/Linux.yml +++ b/tasks/distribution/Linux.yml @@ -12,5 +12,6 @@ with_items: '{{ restic_backups }}' when: - item.name is defined - - item.src is defined or item.stdin is defined and item.stdin == true and item.stdin_cmd is defined + - item.src is defined or item.stdin is defined + - item.src is defined or item.stdin == true and item.stdin_cmd is defined - item.repo in restic_repos diff --git a/tasks/install.yml b/tasks/install.yml index 1c4f371..8efe1d8 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -1,7 +1,13 @@ --- - name: Set restic_url set_fact: - restic_url: 'https://github.com/restic/restic/releases/download/v{{ restic_version }}/restic_{{ restic_version }}_{{ ansible_system | lower }}_{{ _platform_map[ansible_architecture] | default(ansible_architecture) }}.bz2' + restic_url_r: 'https://github.com/restic/restic/releases/download/' + arch: ansible_architecture + restic_platform: '{{ _platform_map[arch] | default(arch) }}' + restic_system: '{{ ansible_system | lower }}' + restic_url_v: 'v{{ restic_version }}/restic_{{ restic_version }}_' + restic_file: '{{ restic_system }}_{{ restic_platform }}.bz2' + restic_url: '{{ restic_url_r }}{{ restic_url_v }}{{ restic_file }}' when: restic_url == '' - name: Download client binary @@ -15,7 +21,7 @@ # 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_download_path }}/bin/restic-{{ restic_version }}" + shell: "bzip2 -dc {{ get_url_restic.dest }} > {{ restic_bin_bath }}" args: creates: '{{ restic_download_path }}/bin/restic-{{ restic_version }}' diff --git a/vars/defaults.yml b/vars/defaults.yml index ef4cb1f..ff0bbcf 100644 --- a/vars/defaults.yml +++ b/vars/defaults.yml @@ -9,3 +9,5 @@ _platform_map: restic_create_paths: - '{{ restic_install_path }}/bin' + +restic_bin_bath: '{{ restic_download_path }}/bin/restic-{{ restic_version }}' \ No newline at end of file