ansible-collections / community.general

Ansible Community General Collection
https://galaxy.ansible.com/ui/repo/published/community/general/
GNU General Public License v3.0
793 stars 1.46k forks source link

zypper module is not removing the older version packages. #6564

Open ssreddy39 opened 1 year ago

ssreddy39 commented 1 year ago

Summary

There are following versions of crash-kmp- package installed on my SuSe Linux server.

testvm:~ # rpm -qa|grep crash
crash-kmp-default-7.2.1_k4.12.14_122.127-8.19.2.x86_64
crash-kmp-default-7.2.1_k4.12.14_120-6.42.x86_64
lnxcbt06:~ #

I want to remove the older versions (<7.2.1_k4.12.14_122.127) with zypper module and I ran the following zypper ad-hoc command. I got success code as shown below:

ansible -m zypper -a "name='crash-kmp-default<7.2.1_k4.12.14_122.127' state=removed" -kKb -i testvm, all

testvm| SUCCESS => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python"
    },
    "changed": false,
    "name": [
        "crash-kmp-default<7.2.1_k4.12.14_122.127"
    ],
    "rc": 0,
    "state": "removed",
    "update_cache": false
}

But actually old version of package is still not removed. if removed, I should see the "changed" status for above ansible ad-hoc command.

Issue Type

Bug Report

Component Name

zypper

Ansible Version

$ ansible --version

2.9.27

Community.general Version

$ ansible-galaxy collection list community.general

Configuration

$ ansible-config dump --only-changed

OS / Environment

SuSe Linux 12

Steps to Reproduce

ansible -m zypper -a "name='crash-kmp-default<7.2.1_k4.12.14_122.127' state=removed" -kKb -i testvm, all

Expected Results

I expect the package crash-kmp-default-7.2.1_k4.12.14_120-6.42.x86_64 should be deleted.

Actual Results

Code of Conduct

ansibullbot commented 1 year ago

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

ansibullbot commented 1 year ago

cc @AnderEnder @alxgu @andytom @commel @evrardjp @lrupp @sealor @toabctl click here for bot help