Add CI for software-infrastructure: yamllint, ansible-lint, and ansible-playbook --syntax-check on the playbooks.
Notes: playbooks load ../secrets.yaml, so provide a non-secret stub with dummy values for syntax checks. Roles are submodules; check out only what's needed. Add a baseline of existing lint issues so the check can pass today and fail on new problems.
Acceptance: the workflow runs on push and PR, and a deliberately broken playbook fails it.
Depends on: G2.
Add CI for software-infrastructure: yamllint, ansible-lint, and `ansible-playbook --syntax-check` on the playbooks.
**Notes**: playbooks load `../secrets.yaml`, so provide a non-secret stub with dummy values for syntax checks. Roles are submodules; check out only what's needed. Add a baseline of existing lint issues so the check can pass today and fail on new problems.
**Acceptance**: the workflow runs on push and PR, and a deliberately broken playbook fails it.
Depends on: G2.
claude
added this to the CI/CD 2: Quality gates milestone 2026-11-09 17:06:02 +00:00
Prepared ahead of S8 and G1: committed and tested locally, not yet run on the runner. Commit b15bb33.
What's committed
.gitea/scripts/check-playbooks.sh (what CI runs, and what you run locally):
syntax: ansible-playbook --syntax-check on every top-level playbook (any *.yaml/*.yml with a play-level hosts:), or on the playbooks you name.
lint: ansible-lint on the repo's own files with the production profile. It also applies yamllint's rules, so there's one baseline for both. roles/ is excluded, because roles are linted in their own repos (G5, G6).
Secrets: the script copies the repo to a temp dir and writes empty {} stubs for ../secrets.yaml, vars/secrets.yaml and secrets.yaml there. It never reads, creates or overwrites a real secrets file. No secrets are used.
Baselines, so it passes today and fails on new problems:
.gitea/playbooks-skip.txt: 9 playbooks that fail the syntax check now, each with its reason. Seven use roles that aren't submodules here, helm.yaml uses a helm_repo module that no installed collection provides, and cluster-host.yml has tasks with no action. They're left out of both checks, because ansible-lint can't ignore syntax errors.
.ansible-lint-ignore: 110 existing file/rule findings, mostly fqcn[action-core], var-naming, schema[vars] and yamllint whitespace and indentation rules.
.gitea/workflows/playbooks.yaml: runs in gitea.eom.dev/devops/ci-tools:1.0.0, checks out the role submodules over anonymous HTTPS (all 47 are public, which I checked, and together they're about 17 MB), then runs syntax and lint as separate steps. Manual-only until S8 (#41) passes and G1's image (#49) is published. The push/pull_request trigger, with paths-ignore for docs and images, is in its header. contents: read, concurrency per ref, 20 min timeout, checkout pinned by SHA. The push started no runs; I checked.
docs/ci-cd/playbook-checks.md: how to run it, what to do when it fails, and how to shrink the baselines.
Tested on the workstation, with the script run in a local build of the ci-tools image 1.0.0 against a clone with submodules:
Case
Result
Whole repo
passes (60 playbooks syntax-checked, 9 skipped, lint passes with the baseline), about 40 s
New playbook with an unknown module
syntax fails, naming the playbook and Ansible's error
New playbook with a shell: task and a lowercase name
lint fails on 5 new findings, existing ones stay warnings
all with a new finding
exits 1
After runs
no secrets file outside the temp dir
actionlint 1.7.12, shellcheck and yamllint pass on the workflow and script.
Not tested: a run on the runner, including submodule checkout inside the job container.
Switch the trigger, run it once on main, and show a deliberately broken playbook failing it on a branch or in a cicd-test-* copy.
Follow-up for Eric, not blocking: some of the nine skipped playbooks look dead (five were last changed in 2024 or early 2025). jasmin.yaml, lemmy.yaml and main.yaml changed in July 2026, so their missing roles may just need adding as submodules. Fixing or deleting each one, then removing its skip line, puts it back under CI.
— eom-cicd-roadmap
**Prepared ahead of S8 and G1: committed and tested locally, not yet run on the runner.** Commit b15bb33.
**What's committed**
- `.gitea/scripts/check-playbooks.sh` (what CI runs, and what you run locally):
- `syntax`: `ansible-playbook --syntax-check` on every top-level playbook (any `*.yaml`/`*.yml` with a play-level `hosts:`), or on the playbooks you name.
- `lint`: `ansible-lint` on the repo's own files with the `production` profile. It also applies yamllint's rules, so there's one baseline for both. `roles/` is excluded, because roles are linted in their own repos (G5, G6).
- Secrets: the script copies the repo to a temp dir and writes empty `{}` stubs for `../secrets.yaml`, `vars/secrets.yaml` and `secrets.yaml` there. It never reads, creates or overwrites a real secrets file. No secrets are used.
- Baselines, so it passes today and fails on new problems:
- `.gitea/playbooks-skip.txt`: 9 playbooks that fail the syntax check now, each with its reason. Seven use roles that aren't submodules here, `helm.yaml` uses a `helm_repo` module that no installed collection provides, and `cluster-host.yml` has tasks with no action. They're left out of both checks, because ansible-lint can't ignore syntax errors.
- `.ansible-lint-ignore`: 110 existing file/rule findings, mostly `fqcn[action-core]`, `var-naming`, `schema[vars]` and yamllint whitespace and indentation rules.
- `.ansible-lint`: profile, `offline: true`, excluded paths.
- `.gitea/workflows/playbooks.yaml`: runs in `gitea.eom.dev/devops/ci-tools:1.0.0`, checks out the role submodules over anonymous HTTPS (all 47 are public, which I checked, and together they're about 17 MB), then runs `syntax` and `lint` as separate steps. **Manual-only** until S8 (#41) passes and G1's image (#49) is published. The `push`/`pull_request` trigger, with `paths-ignore` for docs and images, is in its header. `contents: read`, `concurrency` per ref, 20 min timeout, checkout pinned by SHA. The push started no runs; I checked.
- `docs/ci-cd/playbook-checks.md`: how to run it, what to do when it fails, and how to shrink the baselines.
**Tested on the workstation**, with the script run in a local build of the ci-tools image 1.0.0 against a clone with submodules:
| Case | Result |
|---|---|
| Whole repo | passes (60 playbooks syntax-checked, 9 skipped, lint passes with the baseline), about 40 s |
| New playbook with an unknown module | `syntax` fails, naming the playbook and Ansible's error |
| New playbook with a `shell:` task and a lowercase name | `lint` fails on 5 new findings, existing ones stay warnings |
| `all` with a new finding | exits 1 |
| After runs | no secrets file outside the temp dir |
`actionlint` 1.7.12, `shellcheck` and `yamllint` pass on the workflow and script.
**Not tested:** a run on the runner, including submodule checkout inside the job container.
**Remaining before close**
1. G1 (#49) publishes the image, and S8 passes.
2. Switch the trigger, run it once on `main`, and show a deliberately broken playbook failing it on a branch or in a `cicd-test-*` copy.
**Follow-up for Eric, not blocking:** some of the nine skipped playbooks look dead (five were last changed in 2024 or early 2025). `jasmin.yaml`, `lemmy.yaml` and `main.yaml` changed in July 2026, so their missing roles may just need adding as submodules. Fixing or deleting each one, then removing its skip line, puts it back under CI.
— eom-cicd-roadmap
Correction to the follow-up above: six of the skipped playbooks were last changed in 2024 or March 2025, not five. They're alpha-cluster.yaml, bmcluster.yaml, cluster-host.yml, eom.dev.yaml, helm.yaml and libvirtGuests.yaml.
— eom-cicd-roadmap
Correction to the follow-up above: **six** of the skipped playbooks were last changed in 2024 or March 2025, not five. They're `alpha-cluster.yaml`, `bmcluster.yaml`, `cluster-host.yml`, `eom.dev.yaml`, `helm.yaml` and `libvirtGuests.yaml`.
— eom-cicd-roadmap
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Add CI for software-infrastructure: yamllint, ansible-lint, and
ansible-playbook --syntax-checkon the playbooks.Notes: playbooks load
../secrets.yaml, so provide a non-secret stub with dummy values for syntax checks. Roles are submodules; check out only what's needed. Add a baseline of existing lint issues so the check can pass today and fail on new problems.Acceptance: the workflow runs on push and PR, and a deliberately broken playbook fails it.
Depends on: G2.
Prepared ahead of S8 and G1: committed and tested locally, not yet run on the runner. Commit
b15bb33.What's committed
.gitea/scripts/check-playbooks.sh(what CI runs, and what you run locally):syntax:ansible-playbook --syntax-checkon every top-level playbook (any*.yaml/*.ymlwith a play-levelhosts:), or on the playbooks you name.lint:ansible-linton the repo's own files with theproductionprofile. It also applies yamllint's rules, so there's one baseline for both.roles/is excluded, because roles are linted in their own repos (G5, G6).{}stubs for../secrets.yaml,vars/secrets.yamlandsecrets.yamlthere. It never reads, creates or overwrites a real secrets file. No secrets are used..gitea/playbooks-skip.txt: 9 playbooks that fail the syntax check now, each with its reason. Seven use roles that aren't submodules here,helm.yamluses ahelm_repomodule that no installed collection provides, andcluster-host.ymlhas tasks with no action. They're left out of both checks, because ansible-lint can't ignore syntax errors..ansible-lint-ignore: 110 existing file/rule findings, mostlyfqcn[action-core],var-naming,schema[vars]and yamllint whitespace and indentation rules..ansible-lint: profile,offline: true, excluded paths..gitea/workflows/playbooks.yaml: runs ingitea.eom.dev/devops/ci-tools:1.0.0, checks out the role submodules over anonymous HTTPS (all 47 are public, which I checked, and together they're about 17 MB), then runssyntaxandlintas separate steps. Manual-only until S8 (#41) passes and G1's image (#49) is published. Thepush/pull_requesttrigger, withpaths-ignorefor docs and images, is in its header.contents: read,concurrencyper ref, 20 min timeout, checkout pinned by SHA. The push started no runs; I checked.docs/ci-cd/playbook-checks.md: how to run it, what to do when it fails, and how to shrink the baselines.Tested on the workstation, with the script run in a local build of the ci-tools image 1.0.0 against a clone with submodules:
syntaxfails, naming the playbook and Ansible's errorshell:task and a lowercase namelintfails on 5 new findings, existing ones stay warningsallwith a new findingactionlint1.7.12,shellcheckandyamllintpass on the workflow and script.Not tested: a run on the runner, including submodule checkout inside the job container.
Remaining before close
main, and show a deliberately broken playbook failing it on a branch or in acicd-test-*copy.Follow-up for Eric, not blocking: some of the nine skipped playbooks look dead (five were last changed in 2024 or early 2025).
jasmin.yaml,lemmy.yamlandmain.yamlchanged in July 2026, so their missing roles may just need adding as submodules. Fixing or deleting each one, then removing its skip line, puts it back under CI.— eom-cicd-roadmap
Correction to the follow-up above: six of the skipped playbooks were last changed in 2024 or March 2025, not five. They're
alpha-cluster.yaml,bmcluster.yaml,cluster-host.yml,eom.dev.yaml,helm.yamlandlibvirtGuests.yaml.— eom-cicd-roadmap