Skip to content

Commit

Permalink
Merge pull request #355 from krousenick/json-parsing-fix
Browse files Browse the repository at this point in the history
Update list-configured-runners-unix.yml
  • Loading branch information
guenhter authored Dec 4, 2024
2 parents 0bf4281 + 31bed72 commit 7bc0aa0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tasks/list-configured-runners-unix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
check_mode: false
become: "{{ gitlab_runner_system_mode }}"

- name: Filter valid JSON lines
ansible.builtin.set_fact:
valid_json_lines: "{{ registered_runners_json_result.stderr_lines | select('search', '^\\{.*\\}$') | list }}"

- name: Initialze runner list
ansible.builtin.set_fact:
registered_gitlab_runner_names: []
Expand All @@ -15,8 +19,8 @@
registered_gitlab_runner_names: "{{ registered_gitlab_runner_names + [json_item['msg']] }}"
vars:
json_item: "{{ item | from_json }}"
loop: "{{ registered_runners_json_result.stderr_lines }}"
when: "'Executor' in json_item"
loop: "{{ valid_json_lines }}"
when: json_item.get('Executor') is defined
no_log: "{{ gitlab_runner_no_log_secrets | default(omit) }}"

- name: Print registered runners
Expand Down

0 comments on commit 7bc0aa0

Please sign in to comment.