geerlingguy / ansible-role-docker

Ansible Role - Docker
https://galaxy.ansible.com/geerlingguy/docker/
MIT License
1.81k stars 853 forks source link

Does not install the latest version of Docker engine #404

Closed tdoan2010 closed 11 months ago

tdoan2010 commented 1 year ago

Currently, the latest version of the Docker engine is 23.0.1. But when I install Docker using this Ansible role, I only get 20.10.8.

When I manually follow the instruction about how to install Docker on Ubuntu, I got the latest version.

Did I miss any configuration of this role? I suppose it always install the latest version of Docker, but it was not the case.

pagdot commented 1 year ago

Seems like that is a limitation how package managers handle the install command and that ansibles package module doesn't upgrade packages, just makes sure any version of them is installed. See [tasks/main.yml#L19-L34) for reference. According to the package module documentations state parameter at least with some package managers it is supported to set the state to latest to get the latest version of a package.

This ansible role would support this by setting the variable docker_packages_state to latest instead of the default present. This could be added to the documentation of the role.

pagdot commented 1 year ago

Update: Seems like it worked and upgraded my docker packages. Thinking about a few minutes more I'm not sure if the better way to handle this would be to implement package upgrades in general (e.g. using ansible) to make sure that all packages are up to date.

github-actions[bot] commented 1 year ago

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

github-actions[bot] commented 11 months ago

This issue has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details.