Skip to content

Commit 6e4323c

Browse files
authored
Merge pull request #373 from Normo/bump-gitlab-runner-in-molecule
Support manual deb file installation for gitlab-runner version 17.7 or greater
2 parents d2f31e9 + 88dd6d9 commit 6e4323c

File tree

3 files changed

+20
-8
lines changed

3 files changed

+20
-8
lines changed

molecule/gitlab_runner/molecule.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,9 @@ provisioner:
3737
gitlab_runner_concurrent: 4
3838
host_vars:
3939
instancegitlabciopenstack1:
40-
gitlab_runner_version: "16.11.0"
40+
gitlab_runner_version: "17.8.1"
4141
gitlab_runner_deb_file: "https://packages.gitlab.com/runner/gitlab-runner/packages/{{ ansible_distribution | lower }}/{{ ansible_distribution_release | lower }}/gitlab-runner_{{ gitlab_runner_pkg_version }}_amd64.deb/download.deb"
42+
gitlab_runner_helper_images_deb_file: "https://packages.gitlab.com/runner/gitlab-runner/packages/{{ ansible_distribution | lower }}/{{ ansible_distribution_release | lower }}/gitlab-runner-helper-images_{{ gitlab_runner_pkg_version }}_all.deb/download.deb"
4243
gitlab_runner_install_docker: true
4344
gitlab_runner_ssh_public_key: "test_key.pub"
4445
gitlab_runner_ssh_private_key: "test_key"
@@ -68,7 +69,7 @@ provisioner:
6869
locked: true
6970
limit: 10
7071
instancegitlabciopenstack2:
71-
gitlab_runner_version: "16.11.0"
72+
gitlab_runner_version: "17.8.1"
7273
gitlab_runner_install_docker: false
7374
gitlab_runner_ssh_public_key: ""
7475
gitlab_runner_ssh_private_key: ""

roles/gitlab_runner/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ None.
2828
### GitLab-Runner variables
2929

3030
```yaml
31-
gitlab_runner_version: "17.4.0"
31+
gitlab_runner_version: "17.8.1"
3232
```
3333
The version of GitLab-Runner to install.
3434
3535
```yaml
36-
gitlab_runner_pkg_version: "17.4.0-1"
36+
gitlab_runner_pkg_version: "17.8.1-1"
3737
```
3838
The version to be used to determine the GitLab-Runner
3939
[package](https://packages.gitlab.com/runner/gitlab-runner) (optional).

roles/gitlab_runner/tasks/install.debianlike.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,23 @@
5151
ansible.builtin.package_facts:
5252
manager: "auto"
5353

54-
- name: "Install gitlab-runner from a .deb file"
55-
ansible.builtin.apt:
56-
deb: "{{ gitlab_runner_deb_file }}"
57-
allow_downgrade: true
54+
- name: "Install gitlab-runner manually using deb package"
5855
when:
5956
- "gitlab_runner_deb_file | length > 0"
6057
- "'gitlab-runner' not in ansible_facts.packages or
6158
ansible_facts.packages['gitlab-runner'][0].version is version(gitlab_runner_pkg_version, 'ne')"
59+
block:
60+
61+
- name: "Install gitlab-runner-helper-images from a .deb file"
62+
ansible.builtin.apt:
63+
deb: "{{ gitlab_runner_helper_images_deb_file }}"
64+
allow_downgrade: true
65+
when: "gitlab_runner_version is version('17.7.0', 'ge') or gitlab_runner_version | length == 0"
66+
67+
- name: "Install gitlab-runner from a .deb file"
68+
ansible.builtin.apt:
69+
deb: "{{ gitlab_runner_deb_file }}"
70+
allow_downgrade: true
71+
ignore_errors: "{{ ansible_check_mode }}" # ignore errors due to unresolvable dependencies in check mode
72+
6273
...

0 commit comments

Comments
 (0)