Hi,
I have a list like below, and I need to select the sequence which has
"name" attribute equal to "lo0". I use this selectattr statement *{% set
lo0 = interfaces|selectattr("name", "equalto", lo0) | first%}*
But while running the playbook throws me an error {'msg':
"TemplateRuntimeError: no test named 'equalto'", 'failed': True}
interfaces:
- name: lo0
unit0:
ip_primary: 1.1.1.1
ip_secondary: 2.2.2.2
unit1:
ip_primary: 3.3.3.3
ip_secondary: 4.4.4.4
- name: xyz
unit0:
ip_primary: 9.9.9.9
Jinja2 version 2.7.3.
Any pointer what am I missing?
Vishal
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/3fc54c98-07b1-4a6e-a6c3-dbf4ff5a32cd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.