On Thu, 23 Jan 2020 10:54:52 -0800 (PST) jean-christophe manciot <[email protected]> wrote:
> loop: "{{ list|
> selectattr('key3', 'regex', 'regex1|regex2|regex3')|
> list }}"
> [...]
> For instance, if I need to add another constraint like another attribute
> must match another regex alongside "key3" (as an logical AND), I have no
> clue.
It's possible to extend the pipe. For example
loop: "{{ list|
selectattr('key3', 'regex', 'regex1|regex2|regex3')|
selectattr('key4', 'defined')|
list }}"
HTH,
-vlado
--
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 view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/20200123204231.6fbf2d07%40gmail.com.
pgpE5aYo0UZeA.pgp
Description: OpenPGP digital signature
