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 module returns changed when pkg is already the newest version #51758

Closed
BarbzYHOOL opened this issue Feb 5, 2019 · 9 comments
Closed

Apt module returns changed when pkg is already the newest version #51758

BarbzYHOOL opened this issue Feb 5, 2019 · 9 comments
Labels
affects_2.7 This issue/PR affects Ansible v2.7 bug This issue/PR relates to a bug. module This issue/PR relates to a module. P3 Priority 3 - Approved, No Time Limitation packaging Packaging category support:core This issue/PR relates to code supported by the Ansible Engineering Team.

Comments

@BarbzYHOOL
Copy link

SUMMARY

Apt module says changed when program is already installed.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

apt

ANSIBLE VERSION
2.7.4
CONFIGURATION

OS / ENVIRONMENT

deb 9

STEPS TO REPRODUCE
- name: Install packages
  apt:
    name: "{{ item }}"
    state: latest
    default_release: stable
  loop:
    - libncurses-dev
EXPECTED RESULTS

Not changed

ACTUAL RESULTS
libncurses5-dev is already the newest version (6.0+20161126-1+deb9u2).
0 upgraded, 0 newly installed, 0 to remove and 57 not upgraded.
changed: [H2_CT111] => (item=libncurses-dev) => changed=true 
  cache_update_time: 1549369636
  cache_updated: false
  item: libncurses-dev
  stderr: ''
  stderr_lines: []
  stdout: |-
    Reading package lists...
    Building dependency tree...
    Reading state information...
    libncurses5-dev is already the newest version (6.0+20161126-1+deb9u2).
    0 upgraded, 0 newly installed, 0 to remove and 57 not upgraded.
  stdout_lines: <omitted>
@ansibot
Copy link
Contributor

ansibot commented Feb 5, 2019

Files identified in the description:

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

click here for bot help

@ansibot
Copy link
Contributor

ansibot commented Feb 5, 2019

@ansibot ansibot added affects_2.7 This issue/PR affects Ansible v2.7 bug This issue/PR relates to a bug. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Feb 5, 2019
@sivel
Copy link
Member

sivel commented Feb 5, 2019

I cannot duplicate this with a stock debian 9:

On the 2nd execution I only get:

ok: [localhost] => (item=libncurses-dev) => {"cache_update_time": 1549390836, "cache_updated": false, "changed": false, "item": "libncurses-dev"}

For whatever reason, the package_status function must not be properly detecting that it is installed.

Does changing the package to the real name which is libncurses5-dev change this behavior for you?

@ansibot ansibot removed the needs_triage Needs a first human triage before being processed. label Feb 5, 2019
@BarbzYHOOL
Copy link
Author

Works with the real name but I retried with previous name and it still returns "changed"

@sivel
Copy link
Member

sivel commented Feb 5, 2019

Ok, I asked in hopes that it might help track down where the issue is in the current code path.

@sivel sivel added P3 Priority 3 - Approved, No Time Limitation needs_verified This issue needs to be verified/reproduced by maintainer labels Feb 5, 2019
@ansibot ansibot added the packaging Packaging category label Feb 13, 2019
@webknjaz
Copy link
Member

Cannot reproduce this via ansible debian9 --connection docker -i debian9, -m apt -a 'name=libncurses-dev state=latest default_release=stable' with Ansible devel.

@Vanav
Copy link

Vanav commented Nov 5, 2019

Same issue: #57416

@ansibot
Copy link
Contributor

ansibot commented May 16, 2020

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

@sivel
Copy link
Member

sivel commented Nov 30, 2022

As we were never able to verify this, I'm going to close. If you are still having issues with a recent supported version of ansible-core, feel free to open a new issue with an up to date reproducer.

If you have further questions please stop by IRC or the mailing list:

@sivel sivel closed this as completed Nov 30, 2022
@sivel sivel removed the needs_verified This issue needs to be verified/reproduced by maintainer label Nov 30, 2022
@ansible ansible locked and limited conversation to collaborators Dec 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.7 This issue/PR affects Ansible v2.7 bug This issue/PR relates to a bug. module This issue/PR relates to a module. P3 Priority 3 - Approved, No Time Limitation packaging Packaging category support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

No branches or pull requests

5 participants