--- - name: Install borgbackup apt: update_cache: true name: - borgbackup state: present register: apt_result retries: 3 until: apt_result is succeeded - name: Install borgmatic with apt apt: update_cache: true name: - borgmatic state: present register: apt_result retries: 3 until: apt_result is succeeded when: ansible_lsb.release >= 10 - name: Install borgmatic with pip pip: executable: pip3 name: - borgmatic register: pip_result retries: 3 until: pip_result is succeeded when: ansible_lsb.release <= 9 - name: Ensures /etc/borgmatic exists file: path: /etc/borgmatic state: directory mode: 0700 owner: root - name: Deploy ssh private key template: src: "borgbackup/id_ed25519.j2" dest: "/etc/borgbackup/id_ed25519" mode: 0600 owner: root - name: Deploy borgmatic config template: src: "borgmatic/config.yaml.j2" dest: "/etc/borgmatic/config.yaml" - name: Deploy borg cron template: src: "cron.d/borg.j2" dest: "/etc/cron.d/borg"