Skip to content

Commit

Permalink
Merge pull request #333 from IQNeoXen/master
Browse files Browse the repository at this point in the history
add support for 'gitlab-runner register --docker-allowed-pull-policies'
  • Loading branch information
guenhter authored Jun 5, 2024
2 parents 999a2e2 + 51391fd commit e29d8b9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tasks/register-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@
{% if gitlab_runner.docker_oom_kill_disable|default(false) %}
--docker-oom-kill-disable '{{ gitlab_runner.docker_oom_kill_disable|default("false") }}'
{% endif %}
{% for policy in gitlab_runner.docker_allowed_pull_policies|default([]) %}
--docker-allowed-pull-policies "{{ policy }}"
{% endfor %}
{% for policy in gitlab_runner.docker_pull_policy|default([]) %}
--docker-pull-policy "{{ policy }}"
{% endfor %}
Expand Down
14 changes: 14 additions & 0 deletions tasks/update-config-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,20 @@
- restart_gitlab_runner
- restart_gitlab_runner_macos

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

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

0 comments on commit e29d8b9

Please sign in to comment.