# Deep list merging

**URL:** <https://forum.ansible.com/t/deep-list-merging/25184>\
**Category:** Ansible Developer\
**Created:** [August 4, 2017, 7:30pm UTC](https://forum.ansible.com/t/deep-list-merging/25184 "2017-08-04T19:30:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Giles\_Westwood](https://avatars.discourse-cdn.com/v4/letter/g/3ab097/32.png) [@Giles\_Westwood](https://forum.ansible.com/u/Giles_Westwood)\
**Post date:** [August 4, 2017, 7:30pm UTC](https://forum.ansible.com/t/deep-list-merging/25184/1 "2017-08-04T19:30:50Z")

</div>

I wrote some code to deep merge lists and submitted it as a feature request but it’s not been accepted. I thought I’d leave a record of it here if someone else asks for the same feature:-

[https://github.com/ansible/ansible/pull/25438](https://github.com/ansible/ansible/pull/25438)

The feature is optional so wouldn’t have effected the running of Ansible for any users who didn’t want it. Switched on via:-

list\_behaviour = merge

After I wrote it I also discovered someone else had done exactly the same thing but as an action plugin:-

[https://github.com/sailthru/ansible-oss/tree/master/tools/echelon](https://github.com/sailthru/ansible-oss/tree/master/tools/echelon)

The extension I’ve added is to add a set of tests and implement it in core. I do think it needs peer review though especially with regards to how deep the list merging goes, echelon does recursive list merging and I just do it once. If I need to use the feature I will likely have to go the echelon route but a shame given the interest on irc and elsewhere.
