auto-updates: Install and configure dnf-automatic

*dnf-automatic* is an add-on for `dnf` that performs scheduled,
automatic updates.  It works pretty much how I would want it to:
triggered by a systemd timer, sends email reports upon completion, and
only reboots for kernel et al. updates.

In its default configuration, `dnf-automatic.timer` fires every day.  I
want machines to update weekly, but I want them to update on different
days (so as to avoid issues if all the machines reboot at once).  Thus,
the _dnf-automatic_ role uses a systemd unit extension to change the
schedule.  The day-of-the-week is chosen pseudo-randomly based on the
host name of the managed system.
This commit is contained in:
2024-06-12 06:25:17 -05:00
parent af295cec1b
commit 58972cf188
8 changed files with 187 additions and 0 deletions

View File

@@ -100,3 +100,13 @@ promtail_ca: |
0a91HqvOotOnN/416Ek4UTl95jIqy/TvTfRjXX56wSALXqP1iYQM5i3zk3gVEhh4
DaY+6wQ=
-----END CERTIFICATE-----
dnf_automatic_email_from: dnf@pyrocufflink.net
dnf_automatic_email_to: gyrfalcon@ebonfire.com
dnf_automatic_email_host: mail.pyrocufflink.blue
dnf_automatic_schedule: >-
{{ ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
| random(seed=inventory_hostname)
| string
}} *-*-* 04:00:00 America/Chicago