From 1c363a140e3cbc2ed96eeb372cf3abfdb642d3f0 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Fri, 11 Aug 2023 09:17:50 +0200 Subject: apt: configure unattended-upgrades --- roles/apt/templates/02periodic.j2 | 6 ++++++ roles/apt/templates/50unattended-upgrades.j2 | 21 +++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 roles/apt/templates/02periodic.j2 create mode 100644 roles/apt/templates/50unattended-upgrades.j2 (limited to 'roles/apt/templates') diff --git a/roles/apt/templates/02periodic.j2 b/roles/apt/templates/02periodic.j2 new file mode 100644 index 0000000..0c26a8f --- /dev/null +++ b/roles/apt/templates/02periodic.j2 @@ -0,0 +1,6 @@ +APT::Periodic::Enable "1"; +APT::Periodic::Update-Package-Lists "1"; +APT::Periodic::Download-Upgradeable-Packages "1"; +APT::Periodic::Unattended-Upgrade "1"; +APT::Periodic::AutocleanInterval "7"; +APT::Periodic::Verbose "2"; diff --git a/roles/apt/templates/50unattended-upgrades.j2 b/roles/apt/templates/50unattended-upgrades.j2 new file mode 100644 index 0000000..dfb2f9e --- /dev/null +++ b/roles/apt/templates/50unattended-upgrades.j2 @@ -0,0 +1,21 @@ +Unattended-Upgrade::Origins-Pattern { + "origin=${distro_id},codename=${distro_codename}"; + "origin=${distro_id},codename=${distro_codename}-security"; +}; + +Unattended-Upgrade::DevRelease "false"; +Unattended-Upgrade::AutoFixInterruptedDpkg "true"; +Unattended-Upgrade::MinimalSteps "true"; +Unattended-Upgrade::InstallOnShutdown "false"; +Unattended-Upgrade::Mail "root"; +Unattended-Upgrade::MailOnlyOnError "true"; +Unattended-Upgrade::Remove-Unused-Kernel-Packages "true"; +Unattended-Upgrade::Remove-Unused-Dependencies "true"; +Unattended-Upgrade::Automatic-Reboot "{{ apt_unattended_reboot | lower }}"; +Unattended-Upgrade::Automatic-Reboot-Time "{{ apt_unattended_reboot_time }}"; +Unattended-Upgrade::SyslogEnable "true"; + +Dpkg::Options { + "--force-confdef"; + "--force-confold"; +}; -- cgit v1.2.3