0ab423ca55
The data-only rsync left no way to restore a working instance: mysql/ and config/ were never backed up, so a recovery would have files but no shares, users or metadata. Dump the database before syncing files (a DB older than the files is repairable with occ files:scan; a newer one references blobs that never made it into the backup) and ship config/ alongside it. Capture the --chmod=Du=rwx,Dgo=rx flag that had been hand-added to the deployed skudak-cloud script. It was outside git, so every deploy silently reverted it. It now lives in backup_rsync_extra_args. Add OnFailure= alerting. The units failed silently before, which is how an iDrive sync failure sat unnoticed since May. msmtp rather than the esmtp already installed: the OpenSRS relay is port 465 (implicit TLS) and libesmtp only speaks STARTTLS. Exclude nextcloud.log* from the sync and cap log_rotate_size. skudak-cloud was running at loglevel 0 and had written a 64 GB log that was being rsynced and pushed to S3; set it to 2 to match the home instance. Stagger the timers (04:00 / 04:30) so both finish before the 05:00 TrueNAS snapshot task, and bound TimeoutStartSec so a wedged rsync cannot leave the unit activating forever and skip every subsequent trigger. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
35 lines
972 B
YAML
35 lines
972 B
YAML
---
|
|
# Outbound mail for system notifications (backup failures, cron output).
|
|
#
|
|
# msmtp rather than the esmtp already on the box: the OpenSRS relay uses port
|
|
# 465, which is IMPLICIT TLS, and libesmtp/esmtp only speaks STARTTLS. msmtp
|
|
# handles implicit TLS via `tls_starttls off` and mirrors the settings the
|
|
# TrueNAS box already uses.
|
|
# On Fedora the single `msmtp` package already ships /usr/bin/sendmail and
|
|
# /usr/lib/sendmail; there is no separate msmtp-sendmail package (Debian split).
|
|
- name: install msmtp
|
|
become: true
|
|
ansible.builtin.package:
|
|
name: msmtp
|
|
state: present
|
|
tags: mail
|
|
|
|
- name: configure msmtp
|
|
become: true
|
|
ansible.builtin.template:
|
|
src: msmtp/msmtprc.j2
|
|
dest: /etc/msmtprc
|
|
owner: root
|
|
group: root
|
|
mode: 0600
|
|
no_log: true
|
|
tags: mail
|
|
|
|
- name: point the mta alternative at msmtp
|
|
become: true
|
|
community.general.alternatives:
|
|
name: mta
|
|
path: /usr/bin/msmtp-sendmail
|
|
failed_when: false
|
|
tags: mail
|