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

Feature request: Add the ability to hold the docker packages #471

Open
stianlagstad opened this issue Sep 26, 2024 · 0 comments
Open

Feature request: Add the ability to hold the docker packages #471

stianlagstad opened this issue Sep 26, 2024 · 0 comments

Comments

@stianlagstad
Copy link

Thank you for this role!

I found this closed PR from 2021: #262, which introduced a way to hold the docker packages installed through this role. This would be very useful for my organization, which use this ansible role to install docker, but which do not want docker to be automatically upgraded (to avoid interrupting long-running jobs).

We are currently using the role like this:

    - role: geerlingguy.docker
      vars:
        # We wish for docker to be present on the machine, but we don't want it to be upgraded, since that can disturb
        # important ongoing work on the machines. Therefore, we set this docker_packages_state field to "present", as
        # opposed to the default value of "latest".
        docker_packages_state: present
        # We also need to make sure that the docker service is NOT restarted in case anything is updated after all, so
        # we set the docker_restart_handler_state field to "reloaded" as opposed to the default value of "restarted".
        # This will make it so that any running containers are not disturbed by a restart. The new version would then
        # instead be picked up when the machine is restarted.
        docker_restart_handler_state: reloaded

which I believe makes the role behave in such a way that it doesn't upgrade docker if it is present.

However, we also have this task elsewhere in our ansible setup:

- name: Upgrading all packages (Ubuntu/Debian)
  apt:
    upgrade: dist

which leads to docker being upgraded after all.

We could add our own task to hold the docker packages, and manually list the packages that this role installs (ref https://github.com/geerlingguy/ansible-role-docker/blob/master/defaults/main.yml#L5-L9), but then we would need to keep that manually in sync.

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

1 participant