mirror of
https://github.com/roles-ansible/ansible_role_restic_archiver.git
synced 2024-08-16 10:09:49 +02:00
dabf0420d7
* Fixed error when trying to re-initialize b2 repository * Added changelog entry
26 lines
1,008 B
YAML
26 lines
1,008 B
YAML
---
|
|
- 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
|