mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-08 03:30:32 -07:00
[PR #6250/05824a07 backport][stable-6] merge_variables: Fix example section (#6251)
merge_variables: Fix example section (#6250)
(cherry picked from commit 05824a0754
)
Co-authored-by: Roy Lenferink <lenferinkroy@gmail.com>
This commit is contained in:
parent
8ecb322816
commit
fda610cc23
1 changed files with 4 additions and 4 deletions
|
@ -85,7 +85,7 @@ testb__test_dict:
|
||||||
|
|
||||||
|
|
||||||
# Merge variables that end with '__test_dict' and store the result in a variable 'example_a'
|
# Merge variables that end with '__test_dict' and store the result in a variable 'example_a'
|
||||||
example_a: "{{ lookup('community.general.merge_variables', '__test_dict') }}"
|
example_a: "{{ lookup('community.general.merge_variables', '__test_dict', pattern_type='suffix') }}"
|
||||||
|
|
||||||
# The variable example_a now contains:
|
# The variable example_a now contains:
|
||||||
# ports:
|
# ports:
|
||||||
|
@ -93,9 +93,9 @@ example_a: "{{ lookup('community.general.merge_variables', '__test_dict') }}"
|
||||||
# - 3
|
# - 3
|
||||||
|
|
||||||
|
|
||||||
# Merge variables that end with '__test_list', starting with an initial value and store the result
|
# Merge variables that match the '^.+__test_list$' regular expression, starting with an initial value and store the
|
||||||
# in a variable 'example_b'
|
# result in a variable 'example_b'
|
||||||
example_b: "{{ lookup('community.general.merge_variables', '__test_list', initial_value=test_init_list) }}"
|
example_b: "{{ lookup('community.general.merge_variables', '^.+__test_list$', initial_value=test_init_list) }}"
|
||||||
|
|
||||||
# The variable example_b now contains:
|
# The variable example_b now contains:
|
||||||
# - "list init item 1"
|
# - "list init item 1"
|
||||||
|
|
Loading…
Add table
Reference in a new issue