--- # Note: borgmatic is installed via mise (pipx), not managed here. # 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' - name: Deploy borgmatic LaunchAgent plist ansible.builtin.template: src: borgmatic.plist.j2 dest: ~/Library/LaunchAgents/mcquack.eblume.borgmatic.plist mode: '0644' notify: reload borgmatic - name: Check if borgmatic LaunchAgent is loaded ansible.builtin.command: launchctl list mcquack.eblume.borgmatic register: launchctl_check changed_when: false failed_when: false - name: Load borgmatic LaunchAgent if not loaded ansible.builtin.command: launchctl load ~/Library/LaunchAgents/mcquack.eblume.borgmatic.plist when: launchctl_check.rc != 0 failed_when: false