Hi All,
Good day to all.
I am currently working on a scenario where i need to compare two lists and print out the items which match on both lists .
List1 : [‘dba’,‘admin’,‘developer’]
List2 : [’ user1: dba admin’ , ‘user2 : dba developer’, ‘user3 : operator’]
So as per my scenario in comparing above two list sets , the output should be
user1
user2
as both users have dba/admin/developer item in there strings of list 1.
i tried below code but it doesnt seem to give me the output i need:
- name: checking
debug:
msg: “item”
with_nested: - “{{ VlclNewList }}”
- “{{ VlclOldList }}”
when: “(item[1] | difference(item[0]))”
Any help is highly appreciated.
Thanks.