e43c3aaae3
- Borgmatic backup role driven by per-host config in group_vars/all/backup.yml - manage_ssh_keys role with add/remove paths; remove_ssh_key_playbook.yml uses it Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
31 lines
814 B
YAML
31 lines
814 B
YAML
---
|
|
- name: Skip hosts without backup config
|
|
ansible.builtin.debug:
|
|
msg: "No entry in backup_hosts for {{ inventory_hostname }}; skipping backup role."
|
|
when: inventory_hostname not in (backup_hosts | default({}))
|
|
|
|
- name: Configure borgmatic
|
|
when: inventory_hostname in (backup_hosts | default({}))
|
|
block:
|
|
|
|
- name: Install borgmatic
|
|
ansible.builtin.package:
|
|
name: borgmatic
|
|
state: present
|
|
|
|
- name: Ensure /etc/borgmatic exists
|
|
ansible.builtin.file:
|
|
path: /etc/borgmatic
|
|
state: directory
|
|
owner: root
|
|
group: root
|
|
mode: '0750'
|
|
|
|
- name: Deploy borgmatic config
|
|
ansible.builtin.template:
|
|
src: borgmatic.yaml.j2
|
|
dest: /etc/borgmatic/config.yaml
|
|
owner: root
|
|
group: root
|
|
mode: '0640'
|