I’m using restic 0.19.1 compiled with go1.26.4 on linux/arm64 and, while it’s a minor thing, is there a way to distinguish from the restic self-update exit code if the executable actually was updated? It seems to exit with 0 if there was an update or not. This is for tidying-up an Ansible playbook (and yes, it is a minor thing!).
Hi @JimD
This this instead
---
- name: check if restic exists
stat:
path: /usr/local/bin/restic
register: restic_out
- name: Copy restic to the remote server
copy:
src: restic_0.12.1_linux_amd64
dest: /usr/local/bin/restic
owner: root
group: root
mode: '0755'
backup: yes
when: restic_out.stat.exists == false
- name: Updating restic if required
register: restic
shell: "/usr/local/bin/restic self-update"
# args:
# warn: no
failed_when: "restic.rc == 1 or restic.rc == 2 or restic.rc == 4"
changed_when: "'restic is up to date' not in restic.stdout"
when: restic_out.stat.exists == true
Regards,
Savio