Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apt_package doesn't understand `purge` properly #9132

Open
jaymzh opened this issue Dec 3, 2019 · 1 comment
Open

apt_package doesn't understand `purge` properly #9132

jaymzh opened this issue Dec 3, 2019 · 1 comment

Comments

@jaymzh
Copy link
Member

@jaymzh jaymzh commented Dec 3, 2019

Description

If a package is uninstalled but not purged, i.e. in rc state, and you have a purge rule for it, it'll do nothing, thinking it's already removed. However if the action is :purge, it should run the purge on it.

Chef Version

14.14.29-1

Platform Version

Ubuntu 18.04

Replication Case

Remove a package with configuration files then make a chef rule to purge it.

Client Output

[2019-12-03T12:10:37-08:00] INFO: Processing apt_package[linux-image-4.15.0-20-generic] action purge (vcrs_kernels::default line 54)
[2019-12-03T12:10:37-08:00] TRACE: Providers for generic apt_package resource enabled on node include: [Chef::Provider::Package::Apt]
[2019-12-03T12:10:37-08:00] TRACE: Provider for action purge on resource apt_package[linux-image-4.15.0-20-generic] is Chef::Provider::Package::Apt
[2019-12-03T12:10:37-08:00] TRACE: apt_package[linux-image-4.15.0-20-generic] installed version for linux-image-4.15.0-20-generic is (none)
[2019-12-03T12:10:37-08:00] TRACE: apt_package[linux-image-4.15.0-20-generic] candidate version for linux-image-4.15.0-20-generic is 4.15.0-20.21

But notice:

root@hardwired:~# dpkg -l linux-image-4.15.0-20-generic
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                                                                                 Version                                                 Architecture                                            Description
+++-====================================================================================================-=======================================================-=======================================================-==============================================================================================================================================================================================================
rc  linux-image-4.15.0-20-generic                                                                        4.15.0-20.21                                            amd64                                                   Signed kernel image generic
@lamont-granquist

This comment has been minimized.

Copy link
Contributor

@lamont-granquist lamont-granquist commented Dec 5, 2019

#3699 (comment)

this is actually hard, since it will require invasive changes in the communication between the provider and the superclass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.