Skip to content

Commit 8ef7d73

Browse files
committedFeb 17, 2023
add runner.docker.services support
1 parent 831fb29 commit 8ef7d73

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed
 

‎tasks/update-config-runner.yml

+13
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,19 @@
331331
- restart_gitlab_runner
332332
- restart_gitlab_runner_macos
333333

334+
#### [[runners.docker.services]] section ####
335+
- name: "{{ runn_name_prefix }} Set additional services"
336+
blockinfile:
337+
dest: "{{ temp_runner_config.path }}"
338+
content: "{{ lookup('template', 'config.runners.docker.services.j2') if gitlab_runner.docker_services is defined }}"
339+
state: "{{ 'present' if gitlab_runner.docker_services is defined else 'absent' }}"
340+
marker: "# {mark} runners.docker.services"
341+
insertafter: EOF
342+
check_mode: no
343+
notify:
344+
- restart_gitlab_runner
345+
- restart_gitlab_runner_macos
346+
334347
#### [runners.custom_build_dir] section #####
335348
- name: "{{ runn_name_prefix }} Set custom_build_dir section"
336349
lineinfile:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{% for service in gitlab_runner.docker_services %}
2+
[[runners.docker.services]]
3+
{% for attr in service %}
4+
{{ attr }} = {{ service[attr] | to_json }}
5+
{% endfor %}
6+
{% endfor %}

0 commit comments

Comments
 (0)
Please sign in to comment.