jnv / ansible-role-unattended-upgrades

[DEPRECATED] Setup unattended-upgrades on Debian-based systems
https://github.com/jnv/ansible-role-unattended-upgrades/issues/98
GNU General Public License v2.0
272 stars 94 forks source link

Remove `update-notifier-common`. #85

Closed kousu closed 2 years ago

kousu commented 3 years ago

It's been 5 years so this workaround is no longer need. Fixes #47 (and lets me use unattended-upgrades in lieu of bothering all of my users with update notifications every time they log in).

kousu commented 3 years ago

This doesn't work on Ubuntu 20.04 LTS: https://github.com/jnv/ansible-role-unattended-upgrades/issues/47#issuecomment-858707179.

kousu commented 2 years ago

I think this might be working now. On Ubuntu 20.04.3 LTS I was accidentally running with update-notifier-common uninstalled (because I removed ubuntu-advantage-tools) across my small fleet, but I've been getting

[reboot required] unattended-upgrades result for xxx.example.com: SUCCESS

emails for months.

Either I was mistaken -- I read in intel-microcode's changelog that microcode can be updated without a reboot on linux -- or something has been fixed in the last few months. Either way I'd like to submit this for consideration again :)

kousu commented 2 years ago

I deployed my systems with update-notifier-common removed and with this PR applied to my local ansible install, last week and today the first rebootable upgrades happened successfully. It worked! So this should be able to go in!

To prove it works, this package isn't installed:

root@data:~# dpkg-query -s update-notifier-common
dpkg-query: package 'update-notifier-common' is not installed and no information is available
Use dpkg --info (= dpkg-deb --info) to examine archive files.

And the upgrade happened and triggered a reboot:

root@data:~# tail /var/log/unattended-upgrades/unattended-upgrades.log
2022-02-02 06:53:57,164 INFO Allowed origins are: origin=Ubuntu,archive=impish, origin=Ubuntu,archive=impish-security, origin=UbuntuESMApps,archive=impish-apps-security, origin=UbuntuESM,archive=impish-infra-security, origin=Ubuntu,archive=impish-updates, origin=Ubuntu,archive=impish-backports
2022-02-02 06:53:57,165 INFO Initial blacklist: 
2022-02-02 06:53:57,165 INFO Initial whitelist (not strict): 
2022-02-02 06:54:01,781 INFO Packages that will be upgraded: libsmbclient libwbclient0 linux-azure linux-cloud-tools-azure linux-cloud-tools-common linux-headers-azure linux-image-azure linux-libc-dev linux-tools-azure linux-tools-common python3-samba samba samba-common samba-common-bin samba-dsdb-modules samba-libs samba-vfs-modules smbclient
2022-02-02 06:54:01,781 INFO Writing dpkg log to /var/log/unattended-upgrades/unattended-upgrades-dpkg.log
2022-02-02 06:55:37,933 INFO All upgrades installed
2022-02-02 06:55:59,727 INFO Packages that were successfully auto-removed: linux-azure-cloud-tools-5.13.0-1010 linux-azure-headers-5.13.0-1010 linux-azure-tools-5.13.0-1010 linux-cloud-tools-5.13.0-1010-azure linux-headers-5.13.0-1010-azure linux-image-5.13.0-1010-azure linux-modules-5.13.0-1010-azure linux-tools-5.13.0-1010-azure
2022-02-02 06:55:59,727 INFO Packages that are kept back: 
2022-02-02 06:56:00,265 WARNING Found /var/run/reboot-required, rebooting
2022-02-02 06:56:00,279 WARNING Shutdown msg: b"Reboot scheduled for Wed 2022-02-02 12:00:00 EST, use 'shutdown -c' to cancel."
root@data:~# last reboot | head -n 1
reboot   system boot  5.13.0-1013-azur Wed Feb  2 12:00   still running
jnv commented 2 years ago

I am closing this PR since this role has been deprecated. Feel free to suggest alternatives in #98.