feat(gitea_runner): add the gitea_runner role #293

Merged
Defame1297 merged 3 commits from feat/gitea-runner-role into main 2026-11-22 17:28:20 +00:00
Owner

Adds gitea_runner, the third wave 2 role and the third caller of the internal _binary_update role. It is copied from the maintainer's local role, with the changes below.

What changed against the source

  • Update path. The role still downloads the binary and checks its sha256. The stop, backup, swap, restart, version check and rollback are handed to mortis.kamino._binary_update, as traefik and gitea do. The include uses apply tags, so --tags update reaches it. The same two behaviour changes as for traefik come with it:

    • the backup is taken whenever a live binary exists;
    • a failure before the stop no longer restarts the service.
  • Validation runs first, under always (tasks/validate.yml):

    • the version must be a plain X.Y.Z; a leading v is refused;
    • the registration scope format and the prune settings are checked;
    • the collections requirements file is required when the molecule tooling is enabled.

    Before, the scope and prune checks only ran under their own tags.

  • Bug fix: gitea_runner_remove now ends the role. Before, a removal without --tags remove went on to install the runner again and mint a new registration token.

  • Commands take argv: the token mint, the registration and ansible-galaxy.

  • Molecule tooling: gitea_runner_collections_requirements_file defaults to "". It had a playbook-relative default.

  • Spec: gitea_runner_name is now in the argument spec.

  • Dropped: the legacy-name guard and the removed-inputs guard, as in the earlier roles. The registration scope assert, the CI refusal of a forced re-registration, and the mint-before-drop ordering stay.

  • Environment content removed: dependency-bot comments, comments about the source environment, and the trust note, which is now neutral. The meta namespace is mortis.

  • Docs: changelog fragment, README Roadmap and status line, the README line on who calls _binary_update, and the CLAUDE.md role list.

No other default changed. galaxy.yml is not bumped: the release commit is separate.

Scrub check

I grepped the diff and the commit message for:

  • the private domain, host and group names, and private IPv4 ranges;
  • account namespaces, #NNN references and ADR;
  • hosts/, playbooks/, group_vars and host_vars paths;
  • tunnel, DMZ and image-path words.

The remaining hits are intentional:

  • "group_vars or host_vars" in an assert message;
  • the scenario's group_vars key;
  • author: in meta/main.yml;
  • the Roadmap line.

Every gitea-runner hit is the upstream binary, unit or user name.

Verified

  • Commit hooks: ansible-lint (production profile), yamllint, REUSE, changelog lint, gitleaks and Conventional Commits.
  • Pre-push: ansible-test sanity passed.
  • Syntax: --syntax-check of the four scenario playbooks.
  • Script tests: tests/scripts passes (224 tests).
  • --check against localhost: the refused inputs, the CI guard, and the mint assert stopping a forced run.
  • Independent review of the diff against the source role:
    • no blockers;
    • registration, token-mint ordering, config.yaml.j2, prune and remove match the source apart from the changes listed above;
    • argument_specs defaults match defaults/;
    • no_log covers the token tasks;
    • molecule's export of MOLECULE_INVENTORY_FILE to the child playbook was confirmed in the molecule source.

Not verified

  • The scenario has not run yet: no local container runtime, so this PR's Molecule job is its first run. It uses a stub runner and Docker, file:// downloads, and covers update, idempotence, the prune gate, a bad checksum and remove.
  • Not covered by the scenario: registration against a live Gitea, the Docker install and the molecule tooling install.
  • Colour codes: molecule forces colour in the child ansible-playbook. The substring asserts should still match, but that is unconfirmed.

For consumers upgrading from a local copy of this role

  • Set gitea_runner_collections_requirements_file wherever gitea_runner_molecule_enabled is true. Without it the role fails at validation.
  • A leftover old input name is now ignored instead of refused.

After the merge, the release tag is the operator's.

🤖 Generated with Claude Code

Adds `gitea_runner`, the third wave 2 role and the third caller of the internal `_binary_update` role. It is copied from the maintainer's local role, with the changes below. ## What changed against the source - **Update path.** The role still downloads the binary and checks its sha256. The stop, backup, swap, restart, version check and rollback are handed to `mortis.kamino._binary_update`, as `traefik` and `gitea` do. The include uses `apply` tags, so `--tags update` reaches it. The same two behaviour changes as for `traefik` come with it: - the backup is taken whenever a live binary exists; - a failure before the stop no longer restarts the service. - **Validation runs first, under `always` (`tasks/validate.yml`):** - the version must be a plain `X.Y.Z`; a leading `v` is refused; - the registration scope format and the prune settings are checked; - the collections requirements file is required when the molecule tooling is enabled. Before, the scope and prune checks only ran under their own tags. - **Bug fix: `gitea_runner_remove` now ends the role.** Before, a removal without `--tags remove` went on to install the runner again and mint a new registration token. - **Commands take `argv`:** the token mint, the registration and `ansible-galaxy`. - **Molecule tooling:** `gitea_runner_collections_requirements_file` defaults to `""`. It had a playbook-relative default. - **Spec:** `gitea_runner_name` is now in the argument spec. - **Dropped:** the legacy-name guard and the removed-inputs guard, as in the earlier roles. The registration scope assert, the CI refusal of a forced re-registration, and the mint-before-drop ordering stay. - **Environment content removed:** dependency-bot comments, comments about the source environment, and the trust note, which is now neutral. The meta namespace is `mortis`. - **Docs:** changelog fragment, README Roadmap and status line, the README line on who calls `_binary_update`, and the CLAUDE.md role list. No other default changed. `galaxy.yml` is not bumped: the release commit is separate. ## Scrub check I grepped the diff and the commit message for: - the private domain, host and group names, and private IPv4 ranges; - account namespaces, `#NNN` references and `ADR`; - `hosts/`, `playbooks/`, `group_vars` and `host_vars` paths; - tunnel, DMZ and image-path words. The remaining hits are intentional: - "group_vars or host_vars" in an assert message; - the scenario's `group_vars` key; - `author:` in `meta/main.yml`; - the Roadmap line. Every `gitea-runner` hit is the upstream binary, unit or user name. ## Verified - **Commit hooks:** ansible-lint (production profile), yamllint, REUSE, changelog lint, gitleaks and Conventional Commits. - **Pre-push:** `ansible-test sanity` passed. - **Syntax:** `--syntax-check` of the four scenario playbooks. - **Script tests:** `tests/scripts` passes (224 tests). - **`--check` against localhost:** the refused inputs, the CI guard, and the mint assert stopping a forced run. - **Independent review** of the diff against the source role: - no blockers; - registration, token-mint ordering, `config.yaml.j2`, prune and remove match the source apart from the changes listed above; - `argument_specs` defaults match `defaults/`; - `no_log` covers the token tasks; - molecule's export of `MOLECULE_INVENTORY_FILE` to the child playbook was confirmed in the molecule source. ## Not verified - **The scenario has not run yet:** no local container runtime, so this PR's Molecule job is its first run. It uses a stub runner and Docker, `file://` downloads, and covers update, idempotence, the prune gate, a bad checksum and remove. - **Not covered by the scenario:** registration against a live Gitea, the Docker install and the molecule tooling install. - **Colour codes:** molecule forces colour in the child `ansible-playbook`. The substring asserts should still match, but that is unconfirmed. ## For consumers upgrading from a local copy of this role - Set `gitea_runner_collections_requirements_file` wherever `gitea_runner_molecule_enabled` is true. Without it the role fails at validation. - A leftover old input name is now ignored instead of refused. After the merge, the release tag is the operator's. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Claude added 1 commit 2026-11-22 16:38:09 +00:00
feat(gitea_runner): add the gitea_runner role
Build / build (pull_request) Successful in 15s
Lint / lint (pull_request) Successful in 50s
Molecule / molecule (pull_request) Failing after 1m10s
e296eea609
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
Defame1297 added 1 commit 2026-11-22 16:45:12 +00:00
test(gitea_runner): keep the newline after the fail-case touch
Build / build (pull_request) Successful in 14s
Lint / lint (pull_request) Successful in 48s
Molecule / molecule (pull_request) Canceled after 31s
5de1e61bfd
trim_blocks removed the newline after the endif, so the touch and the
gate call ran as one command and the ps-fails case never reached the
gate. An inline expression keeps the line break.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
Defame1297 added 1 commit 2026-11-22 17:00:16 +00:00
Merge remote-tracking branch 'origin/main' into feat/gitea-runner-role
Build / build (pull_request) Successful in 13s
Lint / lint (pull_request) Successful in 48s
Molecule / molecule (pull_request) Successful in 1m39s
a2d1992241
# Conflicts:
#	CLAUDE.md
Defame1297 merged commit a92901156d into main 2026-11-22 17:28:20 +00:00
Defame1297 deleted branch feat/gitea-runner-role 2026-11-22 17:28:20 +00:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mortis/Kamino#293