G2: Create reusable workflows for Ansible, Helm, and Docker repos #50

Open
opened 2026-11-09 17:06:01 +00:00 by claude · 1 comment
Member

Create reusable workflows in this repo under .gitea/workflows/ (for now) so that 45 role repos need only a small caller file. Cover Ansible role lint, Helm lint, and Dockerfile lint.

Acceptance

  • A caller workflow in one role repo uses it successfully.
  • Inputs and usage are documented in docs/ci-cd/adding-ci.md.
  • Reusing from a public repo works from private callers too, or the limit is documented.

Depends on: G1.

Create reusable workflows in this repo under `.gitea/workflows/` (for now) so that 45 role repos need only a small caller file. Cover Ansible role lint, Helm lint, and Dockerfile lint. **Acceptance** - A caller workflow in one role repo uses it successfully. - Inputs and usage are documented in `docs/ci-cd/adding-ci.md`. - Reusing from a public repo works from private callers too, or the limit is documented. Depends on: G1.
claude added this to the CI/CD 2: Quality gates milestone 2026-11-09 17:06:01 +00:00
claude added the cicd
priority
high
labels 2026-11-09 17:06:01 +00:00
claude added this to the CI/CD Roadmap project 2026-11-09 17:07:33 +00:00
Author
Member

Prepared ahead of G1 and S8. Written and tested locally, not yet run on the runner. Commit 1dab776.

What's committed (all workflow_call only, so the commit started no runs; I checked)

  • reusable-ansible-role-lint.yaml: ansible-lint in the tools image. It also applies yamllint's rules, so one .ansible-lint-ignore baseline covers both. The job lints a copy of the role named as the playbooks use it (ericomeehan.<name>, overridable with role-name), because ansible-lint takes the role's name from its directory. The repo's own name resolves too, because galaxy's skeleton tests/test.yml uses it and syntax-check can't be skipped. role-name is a warning, since our roles keep the skeleton meta.
  • reusable-helm-lint.yaml: helm lint, then helm template | kubeconform -strict for Kubernetes 1.31.2 (the cluster's version). Optional extra values files and --strict.
  • reusable-dockerfile-lint.yaml: hadolint on every Dockerfile* / *.Dockerfile, or on a given list. Threshold warning by default. Fails clearly if it finds none.
  • docs/ci-cd/adding-ci.md: caller templates with concurrency and path filters, every input, the command that generates a role baseline, and a test table.

Tested locally. Each workflow's run: steps were taken verbatim from the YAML and run in a local build of the tools image 1.0.0:

Workflow Case Result
role lint ansible-role-gitea as it is fails, 48 findings (mostly name[casing], fqcn)
with a generated baseline passes
baseline plus a new shell: task fails on the new task only
helm helm-jamulus passes
template referencing a missing value fails in helm lint
Service with a string port fails in kubeconform
dockerfile images/ci-tools/Dockerfile passes
FROM debian:latest with unpinned apt fails

actionlint 1.7.12 (with shellcheck) and yamllint pass.

Acceptance status

  • ☐ A caller in one role repo uses it successfully. This needs the tools image published (G1 #49, which waits on S8 #41, P1 #61 and Eric's registry settings) and a working runner.
  • ☑ Inputs and usage are documented in docs/ci-cd/adding-ci.md.
  • ☐ Reuse from private callers. Cross-repo uses: owner/repo/path@ref hasn't been tried on this Gitea yet. I'll test it from a cicd-test-* repo once the runner is stable. If it doesn't resolve, the fallback is generated inline callers, as the doc says.

Next, once unblocked: a cicd-test-* caller (public and private) → ansible-role-gitea's caller replaces demo.yaml (G5).

— eom-cicd-roadmap

**Prepared ahead of G1 and S8. Written and tested locally, not yet run on the runner.** Commit 1dab776. **What's committed** (all `workflow_call` only, so the commit started no runs; I checked) - `reusable-ansible-role-lint.yaml`: `ansible-lint` in the tools image. It also applies yamllint's rules, so one `.ansible-lint-ignore` baseline covers both. The job lints a copy of the role named as the playbooks use it (`ericomeehan.<name>`, overridable with `role-name`), because ansible-lint takes the role's name from its directory. The repo's own name resolves too, because galaxy's skeleton `tests/test.yml` uses it and `syntax-check` can't be skipped. `role-name` is a warning, since our roles keep the skeleton meta. - `reusable-helm-lint.yaml`: `helm lint`, then `helm template | kubeconform -strict` for Kubernetes 1.31.2 (the cluster's version). Optional extra values files and `--strict`. - `reusable-dockerfile-lint.yaml`: `hadolint` on every `Dockerfile*` / `*.Dockerfile`, or on a given list. Threshold `warning` by default. Fails clearly if it finds none. - `docs/ci-cd/adding-ci.md`: caller templates with `concurrency` and path filters, every input, the command that generates a role baseline, and a test table. **Tested locally.** Each workflow's `run:` steps were taken verbatim from the YAML and run in a local build of the tools image 1.0.0: | Workflow | Case | Result | |---|---|---| | role lint | ansible-role-gitea as it is | fails, 48 findings (mostly `name[casing]`, `fqcn`) | | | with a generated baseline | passes | | | baseline plus a new `shell:` task | fails on the new task only | | helm | helm-jamulus | passes | | | template referencing a missing value | fails in `helm lint` | | | Service with a string port | fails in kubeconform | | dockerfile | `images/ci-tools/Dockerfile` | passes | | | `FROM debian:latest` with unpinned apt | fails | `actionlint` 1.7.12 (with shellcheck) and `yamllint` pass. **Acceptance status** - ☐ A caller in one role repo uses it successfully. This needs the tools image published (G1 #49, which waits on S8 #41, P1 #61 and Eric's registry settings) and a working runner. - ☑ Inputs and usage are documented in `docs/ci-cd/adding-ci.md`. - ☐ Reuse from private callers. Cross-repo `uses: owner/repo/path@ref` hasn't been tried on this Gitea yet. I'll test it from a `cicd-test-*` repo once the runner is stable. If it doesn't resolve, the fallback is generated inline callers, as the doc says. Next, once unblocked: a `cicd-test-*` caller (public and private) → ansible-role-gitea's caller replaces `demo.yaml` (G5). — eom-cicd-roadmap
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DevOps/software-infrastructure#50