mirror of
https://github.com/roles-ansible/ansible_role_restic_archiver.git
synced 2024-08-16 10:09:49 +02:00
cleanup sh1t
This commit is contained in:
parent
c84053bb12
commit
6917d299a4
3 changed files with 0 additions and 79 deletions
|
@ -1,26 +0,0 @@
|
||||||
---
|
|
||||||
- name: Initialize repository
|
|
||||||
command: '{{ restic_install_path }}/restic init'
|
|
||||||
environment:
|
|
||||||
RESTIC_REPOSITORY: '{{ item.value.location }}'
|
|
||||||
RESTIC_PASSWORD: '{{ item.value.password }}'
|
|
||||||
AWS_ACCESS_KEY_ID: '{{ item.value.aws_access_key | default("") }}'
|
|
||||||
AWS_SECRET_ACCESS_KEY: '{{
|
|
||||||
item.value.aws_secret_access_key
|
|
||||||
| default("")
|
|
||||||
}}'
|
|
||||||
AWS_DEFAULT_REGION: '{{ item.value.aws_default_region | default("") }}'
|
|
||||||
B2_ACCOUNT_ID: '{{ item.value.b2_account_id | default("") }}'
|
|
||||||
B2_ACCOUNT_KEY: '{{ item.value.b2_account_key | default("") }}'
|
|
||||||
no_log: true
|
|
||||||
register: restic_init
|
|
||||||
changed_when: "'created restic repository' in restic_init.stdout"
|
|
||||||
failed_when:
|
|
||||||
- restic_init.rc != 0
|
|
||||||
- not 'config file already exists' in restic_init.stderr
|
|
||||||
- not 'config already initialized' in restic_init.stderr
|
|
||||||
- not 'config already exists' in restic_init.stderr
|
|
||||||
loop: "{{ restic_repos|dict2items }}"
|
|
||||||
when:
|
|
||||||
- item.value.init is defined
|
|
||||||
- item.value.init
|
|
|
@ -1,6 +0,0 @@
|
||||||
---
|
|
||||||
# tasks file for skeleton
|
|
||||||
|
|
||||||
- name: Message
|
|
||||||
debug:
|
|
||||||
msg: 'Your {{ ansible_system }} is not yet supported'
|
|
|
@ -1,47 +0,0 @@
|
||||||
---
|
|
||||||
- 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: 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
|
|
||||||
file:
|
|
||||||
src: '{{ restic_download_path }}/bin/restic-{{ restic_version }}'
|
|
||||||
path: '{{ restic_install_path }}/restic'
|
|
||||||
state: link
|
|
||||||
force: true
|
|
Loading…
Reference in a new issue