I have a list of nested dict. I would like to use jinja2 generator comprehension to create a list from it.
test_nested_dict_list:
- foo:
a:
x: 1
y: 2
b: 2
- bar:
a:
x: 2
y: 4
b: 4
- debug:
msg: "{{(u.b for u in test_nested_dict_list if u.a.x == 1 ) | list}}"
this cause a error: {"msg": "template error while templating string: expected token ')', got 'for'. String: {{(u.b for u in test_nested_dict_list if u.a.x == 1 ) | list}}"}