Hello
I want to remove items from a variable using reject filter, I have something like this:
vars:
myvar:
- item1
- item2
List is the output of a command which contains contains item1, item2 , item3, item4, item5, I want to remove item1 and 2 ( from myvar ) from the list with the code below
but is not working, any idea what am I doing wrong of different way to accomplish this?
- set_fact:
list_of_items: “{{ list.stdout_lines | reject(‘search’, item ) | list }}”
with_items: “{{ myvar }}”
Thanks
Regards