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

Ansible 2.16 unexpectedly in 2.14-alpine-* and 2.15-alpine-* tags #75

Open
PhipBlitch-Arcadia opened this issue Mar 14, 2024 · 3 comments

Comments

@PhipBlitch-Arcadia
Copy link

PhipBlitch-Arcadia commented Mar 14, 2024

In the 2.14-alpine-* and 2.15-alpine-* tags, It seems like something is pulling in the 2.16.4 version of ansible-core. pip3 reports the expected version, but the cli tools all report 2.16.4:

% docker run --rm -it willhallonline/ansible:2.14-alpine-3.18 /bin/sh
/ansible # pip3 list | grep ansible
ansible                   7.7.0
ansible-core              2.14.14
/ansible # ansible-playbook --version
ansible-playbook [core 2.16.4]
% docker run --rm -it willhallonline/ansible:2.14-alpine-3.19 /bin/sh
/ansible # pip3 list | grep ansible
ansible                   7.7.0
ansible-core              2.14.14
/ansible # ansible-playbook --version
ansible-playbook [core 2.16.4]

The pattern holds through the 2.15-alpine-* tags as well.

Non-alpine tags appear normal:

% docker run --rm -it willhallonline/ansible:2.14-bookworm-slim /bin/sh
# pip3 list | grep ansible
ansible                   7.7.0
ansible-core              2.14.14
# ansible-playbook --version
ansible-playbook [core 2.14.14]

The 2.13-alpine-* tags also seem fine:

docker run --rm -it willhallonline/ansible:2.13-alpine-3.17 /bin/sh
/ansible # pip3 list | grep ansible
ansible            6.7.0
ansible-core       2.13.13
/ansible # ansible-playbook --version
ansible-playbook [core 2.13.13]
@willhallonline
Copy link
Owner

This will be some kind of dependency that has come through (from ansible-lint or ansible). This has actually been a consistent issue with managing older versions. I find it incredibly frustrating 😠 . I'll try to work out why it is happening.

@PhipBlitch-Arcadia
Copy link
Author

I imagine that would be frustrating indeed! Thank you for building and maintaining this project - it is such a useful tool for bringing an old and neglected ansible project up to date!

@PhipBlitch-Arcadia
Copy link
Author

PhipBlitch-Arcadia commented Mar 14, 2024

I took another look, and it appears to be happening in the step

pip3 install --ignore-installed ansible-lint==${ANSIBLE_LINT}

which seems like a reasonable consequence of --ignore-installed. However I assume it's there because without it this line blows up on ERROR: Cannot uninstall 'packaging'.

I don't know if this would be sufficient for all the builds, but I was able to get the correct result under alpine:3.16 / 2.14.14 / 7.7.0 by freezing the packages up to that point into a requirements file:

pip3 install -r <(pip3 freeze) ansible-lint=${ANSIBLE_LINT}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants