Skip to content

Introduce gitlab_runner_package_state which can be set to latest #8

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@ gitlab_runner_concurrency: "{{ ansible_processor_vcpus }}"

# Activate or deactivate privileged runner
gitlab_runner_privileged: true

# The type of package state. Choose from: "present" or "latest"
gitlab_runner_package_state: present
7 changes: 7 additions & 0 deletions tasks/assert.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,10 @@
- gitlab_runner_concurrency is number
- gitlab_runner_concurrency >= 0
quiet: yes

- name: assert | Test if gitlab_runner_package_state is set correctly
ansible.builtin.assert:
that:
- gitlab_runner_package_state is string
- gitlab_runner_package_state in [ "present", "latest" ]
quiet: yes
2 changes: 1 addition & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
- name: Install gitlab-runner
ansible.builtin.package:
name: "{{ gitlab_runner_package }}"
state: present
state: "{{ gitlab_runner_package_state }}"

- name: Register runner
when:
Expand Down
4 changes: 3 additions & 1 deletion vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,6 @@ _gitlab_runner_version_separator:

gitlab_runner_version_separator: "{{ _gitlab_runner_version_separator[ansible_pkg_mgr] }}"

gitlab_runner_package: "gitlab-runner{{ gitlab_runner_version_separator }}{{ gitlab_runner_version }}"
gitlab_runner_package_name: gitlab-runner

gitlab_runner_package: "{{ gitlab_runner_package_name }}{% if gitlab_runner_package_state == 'present' %}{{ gitlab_runner_version_separator }}{{ gitlab_runner_version }}{% endif %}"