ansible-gitlab-runner icon indicating copy to clipboard operation
ansible-gitlab-runner copied to clipboard

Can't find package `gitlab-runner`

Open artinnok opened this issue 11 months ago • 2 comments

Hi @riemers!

Thank you so much for amazing Ansible role - I believe it really helps.

I tried to use it with following playbook:

- name: Setup
  hosts: staging
  become: true
  vars_files:
    - vars/vault.yaml
  tasks:
    - name: Install Gitlab Runner
      include_role:
        name: riemers.gitlab-runner

Managed node specs:

> lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.4 LTS
Release:	20.04
Codename:	focal

> uname -a
Linux staging-master 5.4.0-122-generic #138-Ubuntu SMP Wed Jun 22 15:00:31 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

I got this error:

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

Also I tried to use Ubuntu 22 and got the same error.

I googled and found this issue, maybe it can help for some workaround.

Feel free to ask questions. Hope you can help me with this.

Thanks, Artem.

artinnok avatar Feb 26 '24 17:02 artinnok

Ran into the same issue just now. Not sure about the cause, but I was able to work around this by temporarily removing the failing task as its only purpose is to unpin/ unhold the specified version in order to switch to a different version. As this was an ansible run on a clean install there is no packaged pinned and this step isn't required.

diff --git a/tasks/install-debian.yml b/tasks/install-debian.yml
index bed1dc7..2eed085 100644
--- a/tasks/install-debian.yml
+++ b/tasks/install-debian.yml
@@ -30,12 +30,6 @@
     gitlab_runner_package_state: "latest"
   when: gitlab_runner_package_version is not defined

-- name: (Debian) Unhold GitLab Runner version
-  changed_when: false
-  dpkg_selections:
-    name: "{{ gitlab_runner_package_name }}"
-    selection: install
-
 - name: (Debian) Install GitLab Runner
   apt:
     name: "{{ gitlab_runner_package }}"

Flowm avatar Feb 27 '24 00:02 Flowm

@Flowm thank you for providing details!

I was forced to make few more changes in files:

  • tasks/install-debian.yml
  • tasks/register-runner.yml

Full diff of my changes available at - https://github.com/riemers/ansible-gitlab-runner/compare/master...artinnok:ansible-gitlab-runner:master

Only after such modifications I was able to run this role.

artinnok avatar Feb 27 '24 06:02 artinnok

Seems this message did not get a lot of love. This does not mean it was not seen but time wise might not have made it to proper attention. This is just the clean up action ;)

github-actions[bot] avatar Mar 29 '24 01:03 github-actions[bot]

Hello @riemers!

Using this role to maintain several machines and looking forward for an "official" fix that allows to skip (Debian) Unhold GitLab Runner version. Please..! :)

tmsmako avatar May 16 '24 09:05 tmsmako

Feel free to submit a MR which fixes this. This repo is from-the-community-for-the-community.

guenhter avatar May 16 '24 11:05 guenhter