homeserver/roles/riemers.gitlab-runner/tasks/line-config-runner-windows.yml

15 lines
609 B
YAML

---
- name: (Windows) Ensure section exists
win_lineinfile:
path: "{{ temp_runner_config.path }}"
regexp: '^(\s*)\[{{ section|regex_escape }}\]$'
line: '{{ " " * (section.split(".")|length -1) }}[{{ section }}]'
- name: (Windows) Modify existing line
win_lineinfile:
path: "{{ temp_runner_config.path }}"
insertafter: '\s+\[{{ section | regex_escape }}\]'
regexp: '^(\s*){{ line | to_json | regex_escape }} =.*'
line: '{{ " " * (section.split(".")|length) }}{{ line | to_json }} = {{ gitlab_runner.extra_configs[section][line] | to_json }}'
register: modified_config_line