AnsibleError: template error while templating string: expected token 'end of statement block', got '{'

This is the line that's causing you trouble: {% for int in int_details_{{item.hostname}} %}. You cannot use jinja2 variable expansion inside a jinja2 instruction.

This will solve your current problem: {% for int in lookup('vars', 'int_details_' + item.hostname) %}

标签