--- # Automatic Debian SECURITY patching for the k3s nodes — the package half of the automated upgrade # process. The reboot half is kured (platform/kured), reconciled by Flux; the two are designed # together and neither is useful alone. Full rationale for every decision: # roles/unattended_upgrades/defaults/main.yml and that role's README.md. # # TARGET (R-ENV-02): `k3s_hosts` defaults to dev's `k3s_servers`; prod is # ansible-playbook playbooks/unattended-upgrades.yml -e k3s_hosts=k3s_prod # Same pattern node-baseline.yml and node-health.yml established — `hosts:` is templated before # group_vars exist, so the target is an extra var, never a group_vars value. # # The role is a NO-OP unless `unattended_upgrades_enabled` is true, which is set for prod only in # inventory/group_vars/k3s_prod/vars.yml. Running this against dev changes nothing. # # DELIBERATELY NOT IN site.yml. site.yml is the bring-up chain (node-baseline -> k3s -> # etcd-io-priority -> kube-vip -> cilium -> verify -> flux-bootstrap) and is "not run against prod # casually". Automatic patching is not a prerequisite for anything in that chain and nothing in the # chain depends on it, so adding it there would only widen what a cluster rebuild touches. It is # applied on its own, once, and re-applied when its configuration changes. # # SAFE TO RUN ON A LIVE CLUSTER, AT ANY TIME. This playbook installs and configures the upgrader. It # never runs `apt upgrade`, never restarts k3s, and never reboots — the role asserts the last of # those against apt's own effective config rather than trusting the file it just wrote. The first # unattended upgrade happens at the next timer firing (04:00 +/-60m), and any reboot that upgrade # implies is kured's to schedule, one node at a time, inside 03:00-06:00. # # TAGS. `--tags verify` re-runs only the read-only assertions and the per-node summary, which is the # way to answer "is automatic patching actually working on these boxes, and is anything waiting on a # reboot" without rewriting any configuration: # ansible-playbook playbooks/unattended-upgrades.yml -e k3s_hosts=k3s_prod --tags verify - name: Automatic security upgrades on the k3s nodes (kernel excluded; reboots delegated to kured) hosts: "{{ k3s_hosts | default('k3s_servers') }}" become: true gather_facts: true roles: - unattended_upgrades