fantastic! :-)
My real use case is little more complex:
1. there are other attributes like "key1" or similar to "list" (within
top-level "list") which must be taken into account
2. the regex filter on "key3" is a little more complex (a list of
logical OR)
I tried to to implement the 2 points by expanding your solution, and it
works *beautifully,* despite the fact that some new keys are themselves
list of dictionaries, instead of simple lists or strings.
I used something like:
...
vars:
keys: "{{ ['key1', 'key3', 'key4', 'key5', 'key6']|
intersect(item.keys()|list) }}"
loop: "{{ list|
selectattr('key3', 'regex', 'regex1|regex2|regex3')|
list }}"
Finally, is there an *online documentation* that you would recommend to
learn all the necessary tools to be able to perform such great filters (the
ansible documentation is very sparse on that subject)?
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.
--
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/2e96aff4-e9ed-4a9e-8034-3b904f75bd10%40googlegroups.com.