Skip to content

Commit

Permalink
Remove run_once when download restic binary
Browse files Browse the repository at this point in the history
The task is executed only on the first host when the roles runs in multiple hosts.
Removing run_once should fix this issue.

```
TASK [hadret.restic : ensure restic installation directory exist] ***********************************************************
ok: [vm1.local]
ok: [vm2.local]

TASK [hadret.restic : download restic binary] *******************************************************************************
ok: [vm1.local]

TASK [hadret.restic : decompress restic binary] *****************************************************************************
ok: [vm1.local]
fatal: [vm2.local]: FAILED! => {"changed": true, "cmd": "bzip2 -dc /tmp/restic_0.9.5_linux_amd64.bz2 > /tmp/restic_0.9.5_amd64", "delta": "0:00:00.008050", "end": "2019-10-23 10:45:41.240274", "msg": "non-zero return code", "rc": 1, "start": "2019-10-23 10:45:41.232224", "stderr": "bzip2: Can't open input file /tmp/restic_0.9.5_linux_amd64.bz2: No such file or directory.", "stderr_lines": ["bzip2: Can't open input file /tmp/restic_0.9.5_linux_amd64.bz2: No such file or directory."], "stdout": "", "stdout_lines": []}

TASK [hadret.restic : copy restic binary] ***********************************************************************************
ok: [vm1.local]
```
  • Loading branch information
asosso committed Oct 23, 2019
1 parent ab4d44f commit c725cf5
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
get_url:
url: "https://github.com/restic/restic/releases/download/v{{ restic_version }}/restic_{{ restic_version }}_{{ ansible_system | lower }}_{{ go_arch_map[ansible_architecture] | default(ansible_architecture) }}.bz2" # noqa 204
dest: "/tmp/restic_{{ restic_version }}_{{ ansible_system | lower }}_{{ go_arch_map[ansible_architecture] | default(ansible_architecture) }}.bz2" # noqa 204
run_once: true

- name: decompress restic binary
shell: "bzip2 -dc /tmp/restic_{{ restic_version }}_{{ ansible_system | lower }}_{{ go_arch_map[ansible_architecture] | default(ansible_architecture) }}.bz2 > /tmp/restic_{{ restic_version }}_{{ go_arch_map[ansible_architecture] | default(ansible_architecture) }}" # noqa 204
Expand Down

0 comments on commit c725cf5

Please sign in to comment.