The goal is to* select all the lines of a list which do NOT contain a
specific word*.
For instance, "{{ files }}" contains a list of filenames. We need to select
all the filenames which do not include the word 'all'.
So with:
files:
- aaaaaaaaaaa
- bbbbbbbbbbb
- cccccccccccc
- d-all-ddddddd
The expected result would be:
files_filtered::
- aaaaaaaaaaa
- bbbbbbbbbbb
- cccccccccccc
I unsuccessfully tried:
set_fact:
files_filtered: "{{ files | select('match', '^(.*^((?!all).)*.+)$')
| list }}"
The result is empty.
Any suggestion?
--
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/c700b4dd-1e1c-47f8-98c9-78f64b1adc63%40googlegroups.com.