1
0
Fork 0
mirror of https://github.com/roles-ansible/ansible_role_restic.git synced 2024-12-11 23:41:32 +01:00

ADD: Check that restic has been installed (#16)

* ADD: Check that restic has been installed

* FIX: lint

* Update CHANGELOG.md

* FIX: multiline
This commit is contained in:
Matthias Leutenegger 2020-08-30 22:04:11 +02:00 committed by GitHub
parent b3644e79f7
commit 921f4197f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 0 deletions

View file

@ -4,6 +4,9 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
and [human-readable changelog](https://keepachangelog.com/en/1.0.0/). and [human-readable changelog](https://keepachangelog.com/en/1.0.0/).
## Unreleased ## Unreleased
### Added
* Sanity check for restic binary
## [0.2.7] 2020-08-05 ## [0.2.7] 2020-08-05
### Added ### Added
* Config option to exclude files * Config option to exclude files

View file

@ -21,6 +21,24 @@
owner: '{{ restic_dir_owner }}' owner: '{{ restic_dir_owner }}'
group: '{{ restic_dir_group }}' group: '{{ restic_dir_group }}'
- name: Test the binary
shell: "{{ restic_bin_bath }} version"
ignore_errors: true
register: restic_test_result
- name: Remove faulty binary
file:
path: '{{ restic_bin_bath }}'
state: absent
when: "'FAILED' in restic_test_result.stderr"
- name: Fail if restic could not be installed
fail:
msg: >-
Restic binary has been faulty and has been removed.
Try to re-run the role and make sure you have bzip2 installed!
when: "'FAILED' in restic_test_result.stderr"
- name: Create symbolic link to the correct version - name: Create symbolic link to the correct version
file: file:
src: '{{ restic_download_path }}/bin/restic-{{ restic_version }}' src: '{{ restic_download_path }}/bin/restic-{{ restic_version }}'