Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Ansible tips & tricks | ||||||||
Line: 121 to 121 | ||||||||
Select items from list of dictionariesUse "{{ variable | selectattr('key_name', 'match', 'value') | list }}" | ||||||||
Added: | ||||||||
> > | Instead of selectattr, you can also use rejectattr. | |||||||
Instead of match, you can also use search or regex. See: https://docs.ansible.com/ansible/latest/user_guide/playbooks_tests.html#testing-strings |