v2.0.0: One inventory in YAML

The inventory is one YAML file, and failure alerts go to ntfy and a mail address set in one variable. Rename restic_repo before you upgrade.

The inventory is inventory.yaml now, and the INI file is gone. Group variables moved into it, so one file says which machine is which and what it gets. The second change came out of the backup incident: alerts for failed units go to ntfy and to a mail address set in one variable, never to root.

⚠️
hosts.ini is removed and restic_repo is now restic_repository. Move your hosts and variables to inventory.yaml before you upgrade. The playbook stops at its first task while it still finds restic_repo.

Added

  • alerts role: a failed unit sends a push through ntfy and a mail to alert_mail.
  • restic check on the NAS every Saturday, reading one part in twenty of the data.
  • The NAS warns at 80 % full on /srv, by the same route.

Changed

  • Breaking: the inventory is inventory.yaml, and ansible.cfg points at it.
  • Breaking: restic_repo is now restic_repository.
  • The Proxmox storage nas-dump keeps the last three dumps per guest.

Removed

  • hosts.ini.
  • The mail-root@ unit. The alerts role replaces it.

Fixed

  • The nut role left the UPS driver stopped after the NAS rebooted.
all:
  vars:
    ansible_user: root
    restic_repository: sftp:restic@nas:/srv/restic
    alert_mail: [email protected]
  children:
    pve:
      hosts:
        pve-1: { ansible_host: 10.0.10.11 }
        pve-2: { ansible_host: 10.0.10.12 }
        pve-3: { ansible_host: 10.0.10.13 }
    storage:
      hosts:
        nas: { ansible_host: 10.0.10.20 }
- name: Stop on the old variable name
  ansible.builtin.assert:
    that: restic_repo is not defined
    fail_msg: restic_repo is now restic_repository, see the v2.0.0 notes.

- name: Install the backup script
  ansible.builtin.template:
    src: backup.sh.j2
    dest: /usr/local/bin/backup.sh
    mode: "0700"

Comments

Buy Logbuch