mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
30 lines
749 B
YAML
30 lines
749 B
YAML
|
---
|
||
|
- name: Merge recursive by 'name', prepend lists 'remove present'
|
||
|
set_fact:
|
||
|
list3: "{{ [list1, list2]|
|
||
|
community.general.lists_mergeby('name',
|
||
|
recursive=true,
|
||
|
list_merge='prepend_rp') }}"
|
||
|
vars:
|
||
|
list1:
|
||
|
- name: myname01
|
||
|
param01:
|
||
|
x: default_value
|
||
|
y: default_value
|
||
|
list:
|
||
|
- default_value
|
||
|
- name: myname02
|
||
|
param01: [1, 1, 2, 3]
|
||
|
|
||
|
list2:
|
||
|
- name: myname01
|
||
|
param01:
|
||
|
y: patch_value
|
||
|
z: patch_value
|
||
|
list:
|
||
|
- patch_value
|
||
|
- name: myname02
|
||
|
param01: [3, 4, 4, {key: value}]
|
||
|
- debug:
|
||
|
var: list3
|