Copied from the maintainer's local role and reworked for the Collection: the binary swap and rollback of an update go through the internal _binary_update role, input checks move to tasks/validate.yml, the removal ends the role, commands take argv, and the molecule tooling needs an explicit collections requirements file. Adds a molecule scenario with stub Docker, runner and release files. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
41 lines
1.3 KiB
YAML
41 lines
1.3 KiB
YAML
---
|
|
# The user module does not create a named primary group; on a fresh host it would fail with
|
|
# "Group <gitea_runner_group> does not exist".
|
|
- name: Ensure runner group exists
|
|
become: true
|
|
ansible.builtin.group:
|
|
name: "{{ gitea_runner_group }}"
|
|
system: true
|
|
tags: [gitea_runner, prereqs, always]
|
|
|
|
- name: Ensure runner user exists
|
|
become: true
|
|
ansible.builtin.user:
|
|
name: "{{ gitea_runner_user }}"
|
|
group: "{{ gitea_runner_group }}"
|
|
home: "{{ gitea_runner_home }}"
|
|
create_home: true
|
|
system: true
|
|
tags: [gitea_runner, prereqs, always]
|
|
|
|
- name: Check if runner is installed
|
|
ansible.builtin.stat:
|
|
path: "{{ gitea_runner_install_dir }}/gitea-runner"
|
|
register: gitea_runner_bin
|
|
tags: [gitea_runner, prereqs, always]
|
|
|
|
- name: Check if runner is registered
|
|
# become: the work dir is 0750 gitea_runner_user, unreadable when ansible_user is another
|
|
# account.
|
|
become: true
|
|
ansible.builtin.stat:
|
|
path: "{{ gitea_runner_work_dir }}/.runner"
|
|
register: gitea_runner_state
|
|
tags: [gitea_runner, prereqs, always]
|
|
|
|
- name: Set runner facts
|
|
ansible.builtin.set_fact:
|
|
gitea_runner_installed: "{{ gitea_runner_bin.stat.exists }}"
|
|
gitea_runner_registered: "{{ gitea_runner_state.stat.exists }}"
|
|
tags: [gitea_runner, prereqs, always]
|