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.
--
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/d60d6161-51dc-44bd-835f-83b8dc5fca7bn%40googlegroups.com.