Skip to content

Commit

Permalink
Add support for setting check_interval
Browse files Browse the repository at this point in the history
  • Loading branch information
fkleon authored and guenhter committed Mar 14, 2024
1 parent 149f22e commit 1a6e8d7
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
4 changes: 4 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ gitlab_runner_executable: "{{ gitlab_runner_package_name }}"
# Maximum number of global jobs to run concurrently
gitlab_runner_concurrent: "{{ ansible_processor_vcpus }}"

# Defines the interval length, in seconds, between the runner checking for new jobs.
# The default value is 0. If set to 0 or lower, the default value of GitLab runner is used, which is 3.
gitlab_runner_check_interval: 0

# GitLab coordinator URL
gitlab_runner_coordinator_url: https://gitlab.com
# GitLab registration token
Expand Down
13 changes: 13 additions & 0 deletions tasks/global-setup-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,19 @@
- restart_gitlab_runner_macos
- restart_gitlab_runner_windows

- name: (Windows) Set check_interval option
lineinfile:
dest: "{{ gitlab_runner_config_file }}"
regexp: ^check_interval =.*
line: check_interval = {{ gitlab_runner_check_interval }}
insertafter: \s*concurrent.*
state: present
no_log: "{{ gitlab_runner_no_log_secrets | default(omit) }}"
become: "{{ gitlab_runner_system_mode }}"
notify:
- restart_gitlab_runner
- restart_gitlab_runner_windows

- name: (Windows) Add listen_address to config
win_lineinfile:
dest: "{{ gitlab_runner_config_file }}"
Expand Down
13 changes: 13 additions & 0 deletions tasks/global-setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,19 @@
- restart_gitlab_runner
- restart_gitlab_runner_macos

- name: Set check_interval option
lineinfile:
dest: "{{ gitlab_runner_config_file }}"
regexp: ^check_interval =
line: check_interval = {{ gitlab_runner_check_interval }}
insertafter: \s*concurrent.*
state: present
no_log: "{{ gitlab_runner_no_log_secrets | default(omit) }}"
become: "{{ gitlab_runner_system_mode }}"
notify:
- restart_gitlab_runner
- restart_gitlab_runner_macos

- name: Add listen_address to config
lineinfile:
dest: "{{ gitlab_runner_config_file }}"
Expand Down

0 comments on commit 1a6e8d7

Please sign in to comment.