ansible-gitlab-runner
ansible-gitlab-runner copied to clipboard
Can't find package `gitlab-runner`
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.
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 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.
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 ;)
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..! :)
Feel free to submit a MR which fixes this. This repo is from-the-community-for-the-community.