Files
claudeandClaude Opus 5.5 b15bb337e9 G3: syntax-check and lint this repo's playbooks in CI
.gitea/scripts/check-playbooks.sh runs ansible-playbook --syntax-check on
every top-level playbook and ansible-lint (production profile, with
yamllint's rules) on the repo's own files, in a temporary copy with empty
secrets stubs, so it never touches a real secrets file. Roles are excluded;
they're linted in their own repos.

Baselines so the check passes today and fails on new problems:
- .gitea/playbooks-skip.txt: nine playbooks that fail the syntax check now
  (missing roles, an unknown module, an unfinished playbook), with reasons.
- .ansible-lint-ignore: 110 existing file/rule findings.

The workflow (.gitea/workflows/playbooks.yaml) is manual-only until S8 passes
and the ci-tools image is published; its header has the push/pull_request
trigger. Docs: docs/ci-cd/playbook-checks.md.

Refs DevOps/software-infrastructure#51

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 09:25:00 -05:00

50 lines
1.4 KiB
YAML

# Syntax-check and lint this repo's playbooks. DevOps/software-infrastructure#51 (G3).
# Docs: docs/ci-cd/playbook-checks.md.
#
# Manual-only for now: the shared runner is still being stabilised (S3-S8,
# #36-#41), and the ci-tools image isn't published yet (G1, #49). Once both
# are done, replace the trigger with:
#
# push:
# branches: [main]
# paths-ignore: ["docs/**", "images/**", "**.md"]
# pull_request:
# paths-ignore: ["docs/**", "images/**", "**.md"]
#
# No secrets are used. Playbooks get an empty secrets stub in a temporary
# copy of the repo (see .gitea/scripts/check-playbooks.sh).
name: playbooks
on:
workflow_dispatch:
concurrency:
group: playbooks-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
check:
runs-on: ubuntu-latest
container:
image: gitea.eom.dev/devops/ci-tools:1.0.0
timeout-minutes: 20
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
- name: Check out role submodules (all public, over HTTPS)
run: |
git config --global --add safe.directory "$PWD"
git -c url."https://gitea.eom.dev/".insteadOf="git@gitea.eom.dev:" \
submodule update --init --jobs 4
- name: Syntax check
run: sh .gitea/scripts/check-playbooks.sh syntax
- name: ansible-lint (with yamllint rules)
if: ${{ !cancelled() }}
run: sh .gitea/scripts/check-playbooks.sh lint