Files
infrastructure/scripts/ci/check_ansible_syntax.sh
T
spektr f48f831e82 M5: statische CI ohne Serverzugang (Gitea Actions) + 2 gebrochene Doku-Links fixen
- .gitea/workflows/ci-static.yml: Jobs secret-scan, yamllint, ansible-syntax,
  markdown-links; Job-Image python:3.13-bookworm per Digest gepinnt
- ci/requirements-ci.txt (ansible-core==2.21.4 wie Control-Node, yamllint==1.37.0),
  .yamllint, scripts/ci/{secret_scan.py,check_links.py,check_ansible_syntax.sh}
- lokal gegen das Repo geprueft: alle 4 Checks gruen
- Linkfixes: GNENC-001 (../ -> ../../), GNAI-018 (ein ../ zu viel)

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-11-11 05:41:40 +01:00

22 lines
757 B
Bash

#!/bin/bash
# Syntax-Check aller Ansible-Projekte im Repo (CI, GNAI-001 M5).
# ansible-core kommt gepinnt aus shared/ansible/requirements-control.txt.
set -euo pipefail
cd "$(git rev-parse --show-toplevel)"
fail=0
while IFS= read -r cfg; do
dir=$(dirname "$cfg")
echo "== Projekt $dir =="
while IFS= read -r pb; do
(cd "$dir" && ansible-playbook -i /dev/null "$pb" --syntax-check >/dev/null 2>&1) \
|| { (cd "$dir" && ansible-playbook -i /dev/null "$pb" --syntax-check) || true; fail=1; }
done < <(cd "$dir" && ls playbooks/*.yml 2>/dev/null || true)
done < <(git ls-files -z 'ansible.cfg' | tr '\0' '\n' | grep -v '^\.venv/')
if [ "$fail" -ne 0 ]; then
echo "ANSIBLE-SYNTAX: FEHLER (siehe oben)"
exit 1
fi
echo "ANSIBLE-SYNTAX: OK"