Skip to content

Commit

Permalink
Merge pull request #227 from indrat/docker-helper-image
Browse files Browse the repository at this point in the history
Enable setting the helper_image option for docker executors
  • Loading branch information
riemers authored Mar 16, 2022
2 parents 17809c6 + fb67ec2 commit deacfad
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
3 changes: 3 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ gitlab_runner_runners:
concurrent_specific: '0'
# The default Docker image to use. Required when executor is `docker`.
docker_image: ''
# Set to override the default helper image that is used.
# docker_helper_image: 'gitlab/gitlab-runner-helper-linux:latest'
#
# The tags assigned to the runner.
tags: []
# Indicates whether this runner can pick jobs without tags.
Expand Down
3 changes: 3 additions & 0 deletions tasks/register-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@
--post-build-script "{{ gitlab_runner.post_build_script }}"
{% endif %}
--docker-image '{{ gitlab_runner.docker_image|default("alpine") }}'
{% if gitlab_runner.docker_helper_image is defined %}
--docker-helper-image "{{ gitlab_runner.docker_helper_image }}"
{% endif %}
{% if gitlab_runner.docker_privileged|default(false) %}
--docker-privileged
{% endif %}
Expand Down
13 changes: 13 additions & 0 deletions tasks/update-config-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,19 @@
- restart_gitlab_runner
- restart_gitlab_runner_macos

- name: "{{ runn_name_prefix }} Set docker helper image option"
lineinfile:
dest: "{{ temp_runner_config.path }}"
regexp: '^\s*helper_image ='
line: ' helper_image = {{ gitlab_runner.docker_helper_image|default('') | to_json }}'
state: "{{ 'present' if gitlab_runner.docker_helper_image is defined else 'absent' }}"
insertafter: '^\s*\[runners\.docker\]'
backrefs: no
check_mode: no
notify:
- restart_gitlab_runner
- restart_gitlab_runner_macos

- name: "{{ runn_name_prefix }} Set docker privileged option"
lineinfile:
dest: "{{ temp_runner_config.path }}"
Expand Down

0 comments on commit deacfad

Please sign in to comment.