The following is a task, which is throwing me an error because jinja2 templating doesnt support this.
- name: Print the ip address
debug:
msg: "{{ ansible_{{ item }}['ipv4']['address'] }}"
with_items: "{{ ansible_interfaces|reject('search', 'lo')|list|sort }}"
The error thrown is:
"msg": "template error while templating string: expected token 'end of print statement', got '{'. String: {{ ansible_{{ item }}['ipv4']['address'] }}"
Any pointers on how to solve this issue?