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

Debian Unhold: Failed to find package from ansible-core >=2.16 #301

Closed
wknd opened this issue Dec 7, 2023 · 1 comment · Fixed by #303
Closed

Debian Unhold: Failed to find package from ansible-core >=2.16 #301

wknd opened this issue Dec 7, 2023 · 1 comment · Fixed by #303

Comments

@wknd
Copy link

wknd commented Dec 7, 2023

The role fails to install on Debian/Ubuntu when using ansible-core >=2.16 on the (Debian) Unhold GitLab Runner version task.
It will not fail if gitlab-runner is already installed previously.

...
TASK [riemers.gitlab-runner : (Debian) Set gitlab_runner_package_name] ******************************************************************************************************
ok: [10.20.1.55]

TASK [riemers.gitlab-runner : (Debian) Unhold GitLab Runner version] ********************************************************************************************************
fatal: [10.20.1.55]: FAILED! => {"changed": false, "msg": "Failed to find package 'gitlab-runner' to perform selection 'install'."}

It worked previously when I was at work, but not anymore when I'm at home. I traced it to this change in behavior of dpkg_selections ansible/ansible#81404 .
dpkg_selections will from now on fail if the package isn't installed already.

The simple solution seems to be to place the Unhold task after the Install task.
But I'm not sure if that would create some unintended consequences. If it was previously set to hold, and then you install again, would it install the newly specified version or the one that was hold?

Otherwise I guess using ansible_facts or something to check if the package was installed before using dpkg_selections.

@sergeeximius
Copy link

I just got the same problem on Debain 12 (bookworm). It helped to execute this command manually on a remote server:

sudo apt-cache dumpavail | sudo dpkg --merge-avail
echo gitlab-runner install | sudo dpkg --set-selections

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