Ansible Dry Run workflow in ansible-homelab-mono #220

Open
opened 2026-11-25 08:28:42 +00:00 by Claude · 1 comment
Owner

Part of #166

Question

Build the pre-merge Ansible dry run in Defame1297/ansible-homelab-mono as decided in Pre-merge Ansible dry run without exposing production credentials (decisions 2–8). The PR in that repo touches .gitea/** and docs/agents/**, which are protected file patterns, so a human merges it.

  • .gitea/workflows/ansible-dry-run.yml, workflow Ansible Dry Run, job ansible_dry_run:
    • on: pull_request_target: types: [opened, synchronize, reopened, labeled], with the same paths as provision.yml's push trigger.
    • Guard step (jq over the event JSON):
      • PR author not Claude → run on any listed event.
      • Author Claude → run only when the action is labeled, changes.added_labels[*].name contains Dry run, and sender.login is on the human allowlist.
      • Otherwise exit without posting a status.
    • Check out the PR head SHA explicitly; the default checkout is the base.
    • Production vault password and SSH key, set up and torn down as in provision.yml.
    • scripts/ci/classify_changes.sh against the merge base, then --check --diff for each selected stage, in stage order, with a 20-minute cap per stage. No stages → comment "no Ansible stages affected" and pass.
    • concurrency: group: homelab-provision, cancel-in-progress: false.
    • Job passes when the preview ran. It fails on infrastructure errors only (unreachable host, timeout, syntax). Failed check-mode tasks never fail the job.
    • PR comment that follows Flux Dry Run's comment behaviour. Output is grouped per stage, with failed tasks listed first, never with secret values.
  • Create the Dry run label in the repo.
  • docs/agents/delivery.md section 2: add Ansible Dry Run / ansible_dry_run (pull_request_target): dry-run-gated. This needs delivery: dry-run-gated role and multiple dry-run checks.
  • Observe once on a real bot PR: no run before the label; a run after you add it; a push removes the status from the new head; re-labelling runs it again.

The resolution records the observed status context name and any differences from the above.

Part of #166 ## Question Build the pre-merge Ansible dry run in `Defame1297/ansible-homelab-mono` as decided in [Pre-merge Ansible dry run without exposing production credentials](https://git.rkdr.net/Mortis/Holocron/issues/200) (decisions 2–8). The PR in that repo touches `.gitea/**` and `docs/agents/**`, which are protected file patterns, so a human merges it. - [ ] `.gitea/workflows/ansible-dry-run.yml`, workflow `Ansible Dry Run`, job `ansible_dry_run`: - [ ] `on: pull_request_target: types: [opened, synchronize, reopened, labeled]`, with the same paths as `provision.yml`'s push trigger. - [ ] Guard step (`jq` over the event JSON): - PR author not `Claude` → run on any listed event. - Author `Claude` → run only when the action is `labeled`, `changes.added_labels[*].name` contains `Dry run`, and `sender.login` is on the human allowlist. - Otherwise exit without posting a status. - [ ] Check out the PR head SHA explicitly; the default checkout is the base. - [ ] Production vault password and SSH key, set up and torn down as in `provision.yml`. - [ ] `scripts/ci/classify_changes.sh` against the merge base, then `--check --diff` for each selected stage, in stage order, with a 20-minute cap per stage. No stages → comment "no Ansible stages affected" and pass. - [ ] `concurrency: group: homelab-provision, cancel-in-progress: false`. - [ ] Job passes when the preview ran. It fails on infrastructure errors only (unreachable host, timeout, syntax). Failed check-mode tasks never fail the job. - [ ] PR comment that follows Flux Dry Run's comment behaviour. Output is grouped per stage, with failed tasks listed first, never with secret values. - [ ] Create the `Dry run` label in the repo. - [ ] `docs/agents/delivery.md` section 2: add `Ansible Dry Run / ansible_dry_run (pull_request_target)`: `dry-run-gated`. This needs [delivery: dry-run-gated role and multiple dry-run checks](https://git.rkdr.net/Mortis/Holocron/issues/218). - [ ] Observe once on a real bot PR: no run before the label; a run after you add it; a push removes the status from the new head; re-labelling runs it again. The resolution records the observed status context name and any differences from the above.
Claude added this to the Map: Infra and agent-team packages milestone 2026-11-25 08:28:42 +00:00
Claude added the Wayfinder/Task label 2026-11-25 08:28:42 +00:00
Claude added a new dependency 2026-11-25 08:28:52 +00:00
Author
Owner

Input from delivery: dry-run-gated role and multiple dry-run checks

delivery 0.7.0 (PR 221) accepts the ansible-homelab-mono entry `Ansible Dry Run / ansible_dry_run (pull_request_target)`: dry-run-gated next to the Flux dry-run.

The workflow has to meet these requirements:

  • Run only on the Dry run label, by name. A bare labeled trigger fires on every label, Status/Ready for Human included. That label is one agents add when they stop, so an agent's own label write would run the human's gate.
  • A skipped status is ignored for this check. A job-level if that posts skipped is fine: delivery-ci-checks reads it as still awaiting the gate. Only pending, failure and success count as a run.
  • Confirm the exact status context from a real run. It goes into delivery.md and the branch-protection required checks. If the name is wrong, the check never matches and stays awaiting-gate forever.
  • Unconfirmed: which commit Gitea posts the pull_request_target status on. The agents only read the PR's head SHA. If Gitea posts it on the base commit instead, the check never shows up and the design needs revisiting. Check this on the first run.
## Input from [delivery: dry-run-gated role and multiple dry-run checks](https://git.rkdr.net/Mortis/Holocron/issues/218) `delivery` 0.7.0 ([PR 221](https://git.rkdr.net/Mortis/Holocron/pulls/221)) accepts the `ansible-homelab-mono` entry `` `Ansible Dry Run / ansible_dry_run (pull_request_target)`: dry-run-gated `` next to the Flux `dry-run`. The workflow has to meet these requirements: - **Run only on the `Dry run` label, by name.** A bare `labeled` trigger fires on every label, `Status/Ready for Human` included. That label is one agents add when they stop, so an agent's own label write would run the human's gate. - **A `skipped` status is ignored for this check.** A job-level `if` that posts `skipped` is fine: `delivery-ci-checks` reads it as still awaiting the gate. Only `pending`, `failure` and `success` count as a run. - **Confirm the exact status context from a real run.** It goes into `delivery.md` and the branch-protection required checks. If the name is wrong, the check never matches and stays `awaiting-gate` forever. - **Unconfirmed: which commit Gitea posts the `pull_request_target` status on.** The agents only read the PR's head SHA. If Gitea posts it on the base commit instead, the check never shows up and the design needs revisiting. Check this on the first run.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: Mortis/Holocron#220