Check jinja templates for syntax error (#10667)

Allow to fail early (pre-commit time) for jinja error, rather than
waiting until executing the playbook and the invalid template.

I could not find a simple jinja pre-commit hook in the wild.
This commit is contained in:
Max Gautier
2023-12-06 03:05:24 +01:00
committed by GitHub
parent fe02d21d23
commit d2944d2813
3 changed files with 26 additions and 0 deletions

View File

@ -27,6 +27,14 @@ ansible-lint:
- ansible-lint -v
except: ['triggers', 'master']
jinja-syntax-check:
extends: .job
stage: unit-tests
tags: [light]
script:
- "find -name '*.j2' -exec tests/scripts/check-templates.py {} +"
except: ['triggers', 'master']
syntax-check:
extends: .job
stage: unit-tests