Er maybe?
Checkout my quick implementation at
https://github.com/tartansandal/ansible.git
If I run the following against it
---
- name: merging like a maniac
hosts: localhost
connection: local
vars:
- foo:
- a:
- luck:
a: c
b: d
- b:
- luck:
a: g
e: f
- bar:
- a:
- luck:
z: q
a: t
- baz: "{{ foo | merge(bar) }}"
tasks:
- debug: var=baz
I get:
<eric:ansible> ansible-playbook stub.yml -i hosts
PLAY [merging like a maniac] **************************************************
GATHERING FACTS ***************************************************************
ok: [localhost]
TASK: [debug var=baz] *********************************************************
ok: [localhost] => {
"baz": [
{
"a": [
{
"luck": {
"a": "t",
"b": "d",
"z": "q"
}
}
]
},
{
"b": [
{
"luck": {
"a": "g",
"e": "f"
}
}
]
}
]
}
PLAY RECAP ********************************************************************
localhost : ok=2 changed=0 unreachable=0 failed=0
Kahlil (Kal) Hodgson GPG: C9A02289
Head of Technology (m) +61 (0) 4 2573 0382
DealMax Pty Ltd (w)
+61 (0) 3 9008 5281
Suite 1415
401 Docklands Drive
Docklands VIC 3008 Australia
"All parts should go together without forcing. You must remember that
the parts you are reassembling were disassembled by you. Therefore,
if you can't get them together again, there must be a reason. By all
means, do not use a hammer." -- IBM maintenance manual, 1925