I wanted to update the list with ansible which contains dictionary items based on certain conditions
for example:
list1:
- {"name": "test1", "uid": 100, "gid": 250}
- {"name": "test2", "uid": 101, "gid": 250}
- {"name": "test3", "uid": 103, "gid": 250}
- {"name": "test4", "uid": 104, "gid": 250}
list2: [100, 101]
list3: [102,103]
if uid match with an item in list2 it will change gid=300 and if match with list3 it updates it as 400, the rest items remain the same in the list1
Please suggest how I could generate the list1 with the above conditions