Files
2024-12-14 13:08:21 +01:00

15 lines
646 B
YAML
Executable File

---
- name: Init local borg repository
ansible.builtin.shell: 'BORG_PASSPHRASE={{ borg_encryption_passphrase }} borg init {{ borg_local_repository }} -e {{ borg_encryption_type }}'
args:
creates: "{{ borg_local_repository }}/data"
no_log: "{{ no_log|default('true') }}"
when: not borg_no_local_repository
- name: Init remote borg repository
ansible.builtin.shell: 'sudo -u {{ borg_user }} BORG_PASSPHRASE={{ borg_encryption_passphrase }} borg init {{ borg_remote_repository }} -e {{ borg_encryption_type }}'
no_log: "{{ no_log|default('true') }}"
when:
- borg_remote_repository is defined
- borg_init_remote_repository