mirror of
https://github.com/nikdoof/ansible-borgmatic.git
synced 2025-12-23 07:49:22 +00:00
31 lines
787 B
YAML
31 lines
787 B
YAML
---
|
|
- name: Create /etc/borgmatic folder
|
|
ansible.builtin.file:
|
|
path: /etc/borgmatic
|
|
state: directory
|
|
owner: root
|
|
group: root
|
|
mode: "0700"
|
|
- name: Write borgmatic config
|
|
copy:
|
|
dest: /etc/borgmatic/config.yaml
|
|
owner: root
|
|
group: root
|
|
mode: "0600"
|
|
content: "{{ borgmatic_config | to_nice_yaml( width=50, explicit_start=True, explicit_end=True) }}"
|
|
- name: Create /root/.borgmatic folder
|
|
ansible.builtin.file:
|
|
path: /root/.borgmatic
|
|
state: directory
|
|
owner: root
|
|
group: root
|
|
mode: "0700"
|
|
- name: "Copy SSH key {{ item }} to borgmatic config folder"
|
|
ansible.builtin.copy:
|
|
src: "ssh_keys/{{ item }}"
|
|
dest: "/etc/borgmatic/{{ item }}"
|
|
owner: root
|
|
group: root
|
|
mode: "0600"
|
|
loop: "{{ borgmatic_ssh_keys }}"
|