Skip to content
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

add support for 'gitlab-runner register --docker-allowed-pull-policies' #333

Merged
merged 1 commit into from
Jun 5, 2024
Merged
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 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