cloudera.exe.combine_onto filter – combine two dictionaries
Note
This filter plugin is part of the cloudera.exe collection (version 2.4.1).
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install cloudera.exe.
.
To use it in a playbook, specify: cloudera.exe.combine_onto
.
Synopsis
Create a dictionary (hash/associative array) as a result of merging existing dictionaries.
This is the reverse of the
ansible.builtin.combine
filter.
Input
This describes the input of the filter, the value before | cloudera.exe.combine_onto
.
Parameter |
Comments |
---|---|
First dictionary to combine. |
Positional parameters
This describes positional parameters of the filter. These are the values positional1
, positional2
and so on in the following
example: input | cloudera.exe.combine_onto(positional1, positional2, ...)
Parameter |
Comments |
---|---|
The list of dictionaries to combine |
Keyword parameters
This describes keyword parameters of the filter. These are the values key1=value1
, key2=value2
and so on in the following
example: input | cloudera.exe.combine_onto(key1=value1, key2=value2, ...)
Parameter |
Comments |
---|---|
Behavior when encountering list elements. Choices:
|
|
If Choices:
|
Notes
Note
When keyword and positional parameters are used together, positional parameters must be listed before keyword parameters:
input | cloudera.exe.combine_onto(positional1, positional2, key1=value1, key2=value2)
Examples
# ab => {'a':1, 'b':2, 'c': 4}
ab: {{ {'a':1, 'b':2} | cloudera.exe.combine_onto({'b':3, 'c':4}) }}
many: "{{ dict1 | cloudera.exe.combine_onto(dict2, dict3, dict4) }}"
# defaults => {'a':{'b':3, 'c':4}, 'd': 5}
# customization => {'a':{'c':20}}
# final => {'a':{'b':3, 'c':20}, 'd': 5}
final: "{{ customization | cloudera.exe.combine_onto(defaults, recursive=true) }}"
Return Value
Key |
Description |
---|---|
Resulting merge of supplied dictionaries. Returned: success |