-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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 behavior changed in 2.4 #30638
Labels
affects_2.4
This issue/PR affects Ansible v2.4
bug
This issue/PR relates to a bug.
module
This issue/PR relates to a module.
needs_info
This issue requires further information. Please answer any outstanding questions.
support:core
This issue/PR relates to code supported by the Ansible Engineering Team.
Comments
ansibot
added
affects_2.4
This issue/PR affects Ansible v2.4
bug_report
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
Sep 20, 2017
s-hertel
removed
the
needs_triage
Needs a first human triage before being processed.
label
Sep 22, 2017
The version is not part of the package name. See apt-cache show nginx. They are two separate meta data "Package:" and "Version:". Can't you achieve your desired result with "state: latest"? |
Hi, I'm expecting to pin-point a specific version, that's the goal of my playbook. I've debug print the whole process, and I can assure you that you can't move to a specific version of an installed package anymore. |
mkrizek
added
the
needs_info
This issue requires further information. Please answer any outstanding questions.
label
Mar 19, 2018
ppanczyk
added a commit
to ppanczyk/ansible
that referenced
this issue
Apr 10, 2018
mkrizek
pushed a commit
to mkrizek/ansible
that referenced
this issue
Apr 17, 2018
ilicmilan
pushed a commit
to ilicmilan/ansible
that referenced
this issue
Nov 7, 2018
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
affects_2.4
This issue/PR affects Ansible v2.4
bug
This issue/PR relates to a bug.
module
This issue/PR relates to a module.
needs_info
This issue requires further information. Please answer any outstanding questions.
support:core
This issue/PR relates to code supported by the Ansible Engineering Team.
ISSUE TYPE
COMPONENT NAME
modules/packaging/os/apt.py
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
Running from: Darwin - MacOS Serria 10.12.6 (16G29) OR debian jessie (Python 2.7)
Targeting: Debian jessie (Python 2.7.9)
apt 1.0.9.8.4
aptitude 0.6.11-1+b1
dpkg 1.17.27
SUMMARY
ansible/lib/ansible/modules/packaging/os/apt.py
Line 384 in 174cb1f
ansible/lib/ansible/modules/packaging/os/apt.py
Lines 494 to 503 in 174cb1f
since the release of 2.4, that particular ligne, combined with lines from 494 to 503 (in the same file) leads to a wrong behavior of the apt module
STEPS TO REPRODUCE
$ ansible-playbook playbooks/nginx.yml --extra-vars version="1.12.1-1~dotdeb+8.1"
EXPECTED RESULTS
Let's nginx
1.6.2-5+deb8u5
is intalled and I want to upgrade to1.12.1-1~dotdeb+8.1
The playbook should detect that the package is installed, that the version installed mismatches the version requested, and install the newer version.
BUT, according to line 384,
package_installed = fnmatch.fnmatch(installed_version, version)
which is always False when you want to install a specific version.You can reproduce this if clause on the target machine quite easily in a python console
TASK [install nginx] ***************************************************************************************************************
Wednesday 20 September 2017 16:08:29 +0200 (0:00:00.029) 0:00:00.029 ***
changed: [webserver01]
And nginx installed in it's newer version
ACTUAL RESULTS
nginx version did not change
Thanks for you work, I'll stick in 2.3 for now.
Bye.
The text was updated successfully, but these errors were encountered: