From fda610cc23dbd5609a055fe52e7163bd9e4aede0 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Sun, 26 Mar 2023 14:02:59 +0000 Subject: [PATCH] [PR #6250/05824a07 backport][stable-6] merge_variables: Fix example section (#6251) merge_variables: Fix example section (#6250) (cherry picked from commit 05824a07540b9f66cc38fc05ff9a585467cd9069) Co-authored-by: Roy Lenferink --- plugins/lookup/merge_variables.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/lookup/merge_variables.py b/plugins/lookup/merge_variables.py index f7b784dfe7..cd5fa5b7df 100644 --- a/plugins/lookup/merge_variables.py +++ b/plugins/lookup/merge_variables.py @@ -85,7 +85,7 @@ testb__test_dict: # 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: # ports: @@ -93,9 +93,9 @@ example_a: "{{ lookup('community.general.merge_variables', '__test_dict') }}" # - 3 -# Merge variables that end with '__test_list', starting with an initial value and store the result -# in a variable 'example_b' -example_b: "{{ lookup('community.general.merge_variables', '__test_list', initial_value=test_init_list) }}" +# Merge variables that match the '^.+__test_list$' regular expression, starting with an initial value and store the +# result in a variable 'example_b' +example_b: "{{ lookup('community.general.merge_variables', '^.+__test_list$', initial_value=test_init_list) }}" # The variable example_b now contains: # - "list init item 1"