23 lines
888 B
YAML
23 lines
888 B
YAML
|
|
---
|
||
|
|
# Expands one project entry into `count` runner instances.
|
||
|
|
- name: "Read registration token for {{ project_spec.project }} from .env"
|
||
|
|
ansible.builtin.set_fact:
|
||
|
|
project_token: >-
|
||
|
|
{{ lookup('ansible.builtin.ini', project_spec.token_env,
|
||
|
|
file=env_file, type='properties') }}
|
||
|
|
|
||
|
|
- name: "Fail if token missing for {{ project_spec.project }}"
|
||
|
|
ansible.builtin.assert:
|
||
|
|
that:
|
||
|
|
- project_token | length > 0
|
||
|
|
fail_msg: >-
|
||
|
|
{{ project_spec.token_env }} not found in {{ env_file }}.
|
||
|
|
Mint a fresh registration token (Settings > Actions > Runners) and set it.
|
||
|
|
|
||
|
|
- name: "Install {{ project_spec.count }} runner(s) for {{ project_spec.project }}"
|
||
|
|
ansible.builtin.include_tasks: install_one_runner.yml
|
||
|
|
loop: "{{ range(1, project_spec.count | int + 1) | list }}"
|
||
|
|
loop_control:
|
||
|
|
loop_var: idx
|
||
|
|
label: "{{ project_spec.project }}-{{ idx }}"
|