Ansible has this interesting feature (though I am not sure if Jinja doesn’t provide this out of the box) where you would put something like:
#jinja2: trim_blocks:false
at the beginning of a file to change the behavior for that template invocation. We could probably do something similar ala:
#dtl: raise_on_undefined:true