ansible-role-borg-backup/tasks/05_configure.yml
2025-09-05 11:22:25 +04:00

40 lines
1.2 KiB
YAML

---
- name: Add Borgmatic config file
block:
- name: Ensure /etc/borgmatic exists
ansible.builtin.file:
path: /etc/borgmatic
state: directory
mode: "0700"
owner: "{{ borg_user }}"
group: "{{ borg_group }}"
- name: Ensure /etc/borgmatic.d exists
ansible.builtin.file:
path: /etc/borgmatic.d
state: directory
mode: "0700"
owner: "{{ borg_user }}"
group: "{{ borg_group }}"
when: borg_app_name is defined and borg_app_name | length > 0
- name: Add Borgmatic configuration
ansible.builtin.template:
src: config.yaml.j2
dest: "/etc/borgmatic/{{ borgmatic_config_name }}"
mode: "0600"
owner: "{{ borg_user }}"
group: "{{ borg_group }}"
when: borg_app_name is not defined or borg_app_name | length == 0
- name: Add Borgmatic app configuration
ansible.builtin.template:
src: config.yaml.j2
dest: "/etc/borgmatic.d/{{ borg_app_name }}-{{ borgmatic_config_name }}"
mode: "0600"
owner: "{{ borg_user }}"
group: "{{ borg_group }}"
when: borg_app_name is defined and borg_app_name | length > 0
...