Azure / nxtools

Azure Automanage Machine Configuration Linux DSC resources
Other
13 stars 11 forks source link

nxPackage - On Ubuntu systems when removing a package, leaves residual config, then continues to report package as present #44

Closed eehret closed 7 months ago

eehret commented 11 months ago

Details of the scenario you tried and the problem that is occurring

I have an Ubuntu system on which I configured nxPackage to ensure that the package 'apport' is Absent. The package did get removed, but residual config remained that causes nxPackage to continue reporting the resource as non-compliant, saying that the package is Present when it is not.

Verbose logs showing the problem

I am not sure how to produce verbose logs for this. But here is what apt is reporting after nxPackage attempted the removal:

root@vm-azam-ubuntu20:/home/azops.eric.ehret/scripts# sudo apt list apport
Listing... Done
apport/focal-updates,now 2.20.11-0ubuntu27.27 all [residual-config]
N: There are 2 additional versions. Please use the '-a' switch to see them.

Suggested solution to the issue

There are some suggestions here: https://askubuntu.com/questions/818711/cleaning-ubuntu-from-residual-files-left-after-removed-packages Purging config files might not be desirable though, so perhaps a change is needed in the code that's checking the package status. I haven't had the time to dig through the source yet, so I'm not sure about this.

The DSC configuration that is used to reproduce the issue (as detailed as possible)

    nxPackage apport_not_installed
    {
      Name = "apport"
      Ensure = "Absent"
    }

The operating system the target node is running

Ubuntu 20.04 LTS

Version and build of PowerShell the target node is running

7.3.x

Version of the DSC module that was used

1.2.0

MutemwaRMasheke commented 10 months ago

Thank you for raising this with us @eehret! We are actively looking into this issue.

eehret commented 7 months ago

@MutemwaRMasheke

Can I get an update on this please. Thanks.

MutemwaRMasheke commented 7 months ago

Just published a new nxtools release with fixes for this and other Github issues. https://www.powershellgallery.com/packages/nxtools/1.4.0

Thank you for your feedback!