From 355b29573c3e8d0acae067e932b1abb02a17ccf0 Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Thu, 15 Sep 2016 16:07:55 -0700 Subject: [PATCH] Use default on undefined vars in tests. (#17601) --- test/integration/roles/test_conditionals/tasks/main.yml | 2 +- test/integration/vars_file.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/integration/roles/test_conditionals/tasks/main.yml b/test/integration/roles/test_conditionals/tasks/main.yml index abe7bd24ac..0908b910fb 100644 --- a/test/integration/roles/test_conditionals/tasks/main.yml +++ b/test/integration/roles/test_conditionals/tasks/main.yml @@ -281,7 +281,7 @@ - block: - name: test a with_items loop using a variable with a missing attribute debug: var=item - with_items: "{{cond_bad_attribute.results}}" + with_items: "{{cond_bad_attribute.results | default('')}}" register: result - set_fact: skipped_bad_attribute=False - name: assert the task was skipped diff --git a/test/integration/vars_file.yml b/test/integration/vars_file.yml index c43bf81866..971e16a7a0 100644 --- a/test/integration/vars_file.yml +++ b/test/integration/vars_file.yml @@ -8,5 +8,5 @@ things1: - 2 things2: - "{{ foo }}" - - "{{ foob }}" + - "{{ foob | default('') }}" vars_file_var: 321