# Unsure how to merge this dict/list into a single dict/list

**URL:** <https://forum.ansible.com/t/unsure-how-to-merge-this-dict-list-into-a-single-dict-list/21816>\
**Category:** Ansible Project\
**Created:** [June 20, 2016, 7:46pm UTC](https://forum.ansible.com/t/unsure-how-to-merge-this-dict-list-into-a-single-dict-list/21816 "2016-06-20T19:46:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pporada](https://avatars.discourse-cdn.com/v4/letter/p/b4bc9f/32.png) [@pporada](https://forum.ansible.com/u/pporada)\
**Post date:** [June 20, 2016, 7:46pm UTC](https://forum.ansible.com/t/unsure-how-to-merge-this-dict-list-into-a-single-dict-list/21816/1 "2016-06-20T19:46:45Z")

</div>

> `
> 
> - name: Jinja Example Playbook  
> hosts: localhost  
> connection: local  
> vars\_files:
> - test-role/defaults/container.yml
> - test-role/defaults/container\_env.yml  
> vars:  
> combined\_containers: “{{ (containers + container\_env) | unique}}”
> 
> tasks:
> 
> - name: Container file  
> debug:  
> msg: “{{containers}}”
> - name: Container env file  
> debug:  
> msg: “{{container\_env}}”
> - name: Combined  
> debug:  
> msg: “{{combined\_containers}}”
> - debug:  
> msg: “{{item.name}} - {{item.version}} - {{item.env}}”  
> with\_items:
> - “{{combined\_containers}}”  
> `

> ## `
> 
> container\_env:
> 
> - name: httpd  
> env: Phil
> - name: httpd  
> env: Phil  
> `

`

---

<div class="post-metadata">

**Author:** ![Mike\_Biancaniello](https://avatars.discourse-cdn.com/v4/letter/m/dec6dc/32.png) [@Mike\_Biancaniello](https://forum.ansible.com/u/Mike_Biancaniello)\
**Post date:** [June 21, 2016, 3:21pm UTC](https://forum.ansible.com/t/unsure-how-to-merge-this-dict-list-into-a-single-dict-list/21816/2 "2016-06-21T15:21:36Z")

</div>

It sounds like you are looking to do something like this:

[https://github.com/chepazzo/ansible-filters-extras/blob/master/filter\_plugins/listofdicts.py#L121](https://github.com/chepazzo/ansible-filters-extras/blob/master/filter_plugins/listofdicts.py#L121)
