mirror of https://github.com/ansible/ansible.git
template module - Report syntax error line number (#86101)
Report the line number for Jinja syntax errors in template files.pull/84844/head
parent
8ac5c8580b
commit
a4ae978122
@ -0,0 +1,2 @@
|
|||||||
|
bugfixes:
|
||||||
|
- template module - Report the line number for Jinja syntax errors in template files.
|
||||||
@ -0,0 +1,2 @@
|
|||||||
|
context/controller
|
||||||
|
shippable/posix/group4
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -eux
|
||||||
|
|
||||||
|
ansible-playbook template-file.yml "${@}" | tee template-file.out
|
||||||
|
|
||||||
|
echo "Verifying contents of error reports ..."
|
||||||
|
|
||||||
|
# verify the template-file error report is correct
|
||||||
|
grep 'template-file.j2:5' template-file.out
|
||||||
|
grep '5 {% sorry' template-file.out
|
||||||
|
|
||||||
|
echo "PASS"
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
line 1
|
||||||
|
line 2
|
||||||
|
line 3
|
||||||
|
line 4
|
||||||
|
{% sorry
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
- hosts: localhost
|
||||||
|
gather_facts: no
|
||||||
|
tasks:
|
||||||
|
- template:
|
||||||
|
src: template-file.j2
|
||||||
|
dest: template-file.txt
|
||||||
|
ignore_errors: yes
|
||||||
Loading…
Reference in New Issue