1
0
Fork 0
forked from infra/ansible

forgejo: runner config not being passed to the openshift secret

Signed-off-by: David Kirwan <davidkirwanirl@gmail.com>
This commit is contained in:
David Kirwan 2026-05-28 13:38:48 +01:00
commit f29d91d7af
Signed by: dkirwan
GPG key ID: A5893AB6474AC37D

View file

@ -5,25 +5,23 @@
# releng-1: "0123...hex40"
- name: Find forgejo runner definition files
ansible.builtin.find:
paths: "{{ role_path }}/runners/{{ env }}"
patterns: "*.yml"
register: _forgejo_runner_def_files
ansible.builtin.set_fact:
_forgejo_runner_def_paths: "{{ query('ansible.builtin.fileglob', role_path ~ '/runners/' ~ env ~ '/*.yml') | sort }}"
- name: Build forgejo_runners from definitions and private secrets
ansible.builtin.set_fact:
forgejo_runners: "{{ forgejo_runners | default([]) + [_runner] }}"
loop: "{{ _forgejo_runner_def_files.files | sort(attribute='path') }}"
loop: "{{ _forgejo_runner_def_paths }}"
vars:
_def: "{{ lookup('ansible.builtin.file', item.path) | from_yaml }}"
_def: "{{ lookup('ansible.builtin.file', item) | from_yaml }}"
_secrets: "{{ (env == 'production') | ternary(forgejo_runner_secrets, forgejo_stg_runner_secrets) }}"
_runner: "{{ _def | combine({'secret': _secrets[_def.name]}) }}"
when: _forgejo_runner_def_files.matched > 0
when: _forgejo_runner_def_paths | length > 0
- name: Set empty forgejo_runners when no definition files exist
ansible.builtin.set_fact:
forgejo_runners: []
when: _forgejo_runner_def_files.matched == 0
when: _forgejo_runner_def_paths | length == 0
- name: Validate each runner has a secret in private vars
ansible.builtin.assert: