#1010643 dpkg-reconfigure -f noninteractive unattended-upgrades reverts to installed state

#1010643#5
Date:
2022-05-05 21:36:35 UTC
From:
To:
Hi,
While trying to create an ansible playbook to enable/disable
unattended-upgrades I ran into a strange behavior, it seems that
dpkg-reconfigure is reverting the package to the installed state instead of
applying the change made through debconf, running the postinst script
manually (extracted from the deb to /tmp) does result in the expected
outcome.

Example:
root@debian:~# debconf-show unattended-upgrades
* unattended-upgrades/enable_auto_updates: true
******* run playbook that changes state *********
root@debian:~# debconf-show unattended-upgrades
* unattended-upgrades/enable_auto_updates: false
root@debian:~# dpkg-reconfigure -f noninteractive unattended-upgrades
root@debian:~# debconf-show unattended-upgrades
* unattended-upgrades/enable_auto_updates: true

The same seems to apply in the other direction (false > true).
It is unclear to me if dpkg-reconfigur is triggering the postinst script or
not.

Thanks for the great work,
Eli