mirror of
https://github.com/roles-ansible/ansible_role_restic/
synced 2024-12-12 12:50:18 +01:00
16 lines
512 B
YAML
16 lines
512 B
YAML
---
|
|
- name: Initialize repository
|
|
command: '{{ restic_install_path }}/restic init'
|
|
environment:
|
|
RESTIC_REPOSITORY: '{{ item.value.location }}'
|
|
RESTIC_PASSWORD: '{{ item.value.password }}'
|
|
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
|
|
loop: "{{ restic_repos|dict2items }}"
|
|
when:
|
|
- item.value.init is defined
|
|
- item.value.init
|