ansible templating error

Hi,

I just encountered a funny problem deploying an ansible role. One of the templates didn’t render, and the message was:

AnsibleError: template error while templating string: tag name expected. String:

Then it showed the entire template as the string. This seems to be less than ideal error reporting. It still leaves you guessing about what happened. Is there a way to have it display the exact line number, or variable, in the template which is causing the issue, and not the whole template?

Ultimately it seemed to be solved by upgrading from ansible 5.0.1 to 6.6.0 “pip3 install ansible --upgrade” which also upgraded jinja. Maybe jinja was the cause.