nickjj / ansible-docker

Install / Configure Docker and Docker Compose using Ansible.
MIT License
750 stars 224 forks source link

Versioning pinning not working #111

Closed martinm82 closed 2 years ago

martinm82 commented 3 years ago

When specifying the docker__version to 19.03 the role is still installing the latest and greatest (as of today 20.10) on the target host.

I believe that the problem is the apt pinning config file. When using as version 5:19.03 the latest version of 19.03 is installed. This version string is based on the output of apt-cache madison docker-ce.

nickjj commented 3 years ago

Ah right, in the tests I'm pinning it with the 5: part included https://github.com/nickjj/ansible-docker/blob/master/tests/test.yml#L7.

I feel like I avoided using *[version]* as the pin because it didn't pick it up as a match but maybe that needs to be revisited.

martinm82 commented 3 years ago

You are right, I should have checked the tests before opening this ticket. So shall we just update the docs and state to use the version used by apt itself?

nickjj commented 3 years ago

I recall 5: being around for a while but I'm not sure if it'll be consistent for every release of Docker. It feels like it should be both a documentation fix as well as modifying the default main.yml file to also use it so the role works out of the box.

nickjj commented 3 years ago

Hi, I put up a PR at https://github.com/nickjj/ansible-docker/pull/113 which pins things using Pin: version *{{ docker__version }}* which should allow you to set docker__version: 19.03 instead of 5:19.03 and still have the pin work.

Would you mind testing that PR?

nickjj commented 2 years ago

This has been fixed in https://github.com/nickjj/ansible-docker/commit/a9b15c9ddd43ed61ab8e0ca97fdbc1092af2b0e1 and is available in v2.2.0 of this role.