I think the short answer is that you don't. Ansible has a setting that will allow you to merge dictionaries together, but not lists. This setting is global and applies to all dicts. I'm guessing it doesn't merge lists because there's no way to indicate if your intent is to merge the list or replace it.
Your best bet, here, is to write a filter_plugin that merges the lists. e.g. locked_domains|merge_list(domains.json,'ID') where merge_list() is a function in a filter_plugin that takes 3 arguments: original_list, new_listofdicts, key. There might be with_ statement that does this, but looking at your task, I'm not sure if any will do exactly what you want (depends on how you're going to use locked_domains). -- 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 ansible-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/67fbe902-0a6a-4d62-b688-587c6877e014%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.