Ansible: filter a list by its attributes

To filter a list of dicts you can use the selectattr filter together with the equalto test: network.addresses.private_man | selectattr(“type”, “equalto”, “fixed”) The above requires Jinja2 v2.8 or later (regardless of Ansible version). Ansible also has the tests match and search, which take regular expressions: match will require a complete match in the string, while … Read more