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

15 lines
609 B
YAML
Raw Normal View History

2021-02-13 14:20:18 +01:00
---
- 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