2026-01-13 22:50:28 -08:00
|
|
|
---
|
|
|
|
|
# Note: borgmatic is installed via mise (pipx), not managed here.
|
2026-01-16 12:30:20 -08:00
|
|
|
# This role manages the config file and scheduled LaunchAgent.
|
|
|
|
|
|
|
|
|
|
- name: Ensure borgmatic config directory exists
|
|
|
|
|
ansible.builtin.file:
|
|
|
|
|
path: "{{ borgmatic_config_dir }}"
|
|
|
|
|
state: directory
|
|
|
|
|
mode: '0700'
|
|
|
|
|
|
|
|
|
|
- name: Deploy borgmatic configuration
|
|
|
|
|
ansible.builtin.template:
|
|
|
|
|
src: config.yaml.j2
|
|
|
|
|
dest: "{{ borgmatic_config }}"
|
|
|
|
|
mode: '0600'
|
2026-01-13 22:50:28 -08:00
|
|
|
|
|
|
|
|
- name: Deploy borgmatic LaunchAgent plist
|
|
|
|
|
ansible.builtin.template:
|
|
|
|
|
src: borgmatic.plist.j2
|
|
|
|
|
dest: ~/Library/LaunchAgents/mcquack.eblume.borgmatic.plist
|
|
|
|
|
mode: '0644'
|
2026-01-16 19:33:02 -08:00
|
|
|
notify: Reload borgmatic
|
2026-01-13 22:50:28 -08:00
|
|
|
|
2026-01-14 14:14:52 -08:00
|
|
|
- name: Check if borgmatic LaunchAgent is loaded
|
|
|
|
|
ansible.builtin.command: launchctl list mcquack.eblume.borgmatic
|
2026-01-16 19:33:02 -08:00
|
|
|
register: borgmatic_launchctl_check
|
2026-01-14 14:14:52 -08:00
|
|
|
changed_when: false
|
|
|
|
|
failed_when: false
|
|
|
|
|
|
|
|
|
|
- name: Load borgmatic LaunchAgent if not loaded
|
2026-01-13 22:50:28 -08:00
|
|
|
ansible.builtin.command: launchctl load ~/Library/LaunchAgents/mcquack.eblume.borgmatic.plist
|
2026-01-16 19:33:02 -08:00
|
|
|
when: borgmatic_launchctl_check.rc != 0
|
|
|
|
|
changed_when: true
|
2026-01-13 22:50:28 -08:00
|
|
|
failed_when: false
|