ci + ansible

This commit is contained in:
sangnn
2026-06-20 11:06:27 +07:00
parent a6d74d9316
commit 966578ed58
15 changed files with 637 additions and 30 deletions
+22
View File
@@ -0,0 +1,22 @@
---
# 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 }}"