homeserver/roles/riemers.gitlab-runner/tasks/global-setup-windows.yml

50 lines
1.5 KiB
YAML
Raw Normal View History

2021-02-13 14:20:18 +01:00
---
- name: (Windows) Create .gitlab-runner dir
win_file:
path: "{{ gitlab_runner_config_file_location }}"
state: directory
- name: (Windows) Ensure config.toml exists
win_file:
path: "{{ gitlab_runner_config_file }}"
state: touch
modification_time: preserve
access_time: preserve
- name: (Windows) Set concurrent option
win_lineinfile:
dest: "{{ gitlab_runner_config_file }}"
regexp: '^(\s*)concurrent =.*'
line: '$1concurrent = {{ gitlab_runner_concurrent }}'
state: present
backrefs: yes
notify:
- restart_gitlab_runner
- restart_gitlab_runner_macos
- restart_gitlab_runner_windows
- name: (Windows) Add listen_address to config
win_lineinfile:
dest: "{{ gitlab_runner_config_file }}"
regexp: '^listen_address =.*'
line: 'listen_address = "{{ gitlab_runner_listen_address }}"'
insertafter: '\s*concurrent.*'
state: present
when: gitlab_runner_listen_address | length > 0 # Ensure value is set
notify:
- restart_gitlab_runner
- restart_gitlab_runner_windows
- name: (Windows) Add sentry dsn to config
win_lineinfile:
dest: "{{ gitlab_runner_config_file }}"
regexp: '^sentry_dsn =.*'
line: 'sentry_dsn = "{{ gitlab_runner_sentry_dsn }}"'
insertafter: '\s*concurrent.*'
state: present
when: gitlab_runner_sentry_dsn | length > 0 # Ensure value is set
notify:
- restart_gitlab_runner
- restart_gitlab_runner_macos
- restart_gitlab_runner_windows