0

I am trying to do the following in my template:

{% for user in users %}
  <td >{{ addresses|selectattr('priority','equalto', 1)|selectattr('User','equalto', '{{user.name}}')|list|length }}</td>
{% endfor %}

But for some reason I am getting 0 values in the output. If I remove the

selectattr('User','equalto', '{{user.name}}')

everything seems to be working fine but without the filter by user.name.

Any idea what might be going wrong here?

murlex
  • 73
  • 5
  • [_Moustaches do not stack_](https://stackoverflow.com/questions/67408680/how-can-i-make-ansible-interpret-a-variable-inside-a-variable) > `selectattr('User','equalto', user.name)` – β.εηοιτ.βε Oct 19 '22 at 08:21

0 Answers0