Properly suppress undefined warning

Although there is no harm in this case, the task in question has a
with_items on a variable that is not set because the previous task did
not run. In this case, it did not run because it's in a block with a
when that did not match - but in the context of a task, when is applied
after with_items and is applied to each with_item, rather than to the
task as a whole. To make the task complete, add a |default() jinja
filter so that the undefined variable is replaced with a defined but
empty value.

Change-Id: I2029b7cac3634a5fe7232f6f823e803e1f4250e6
This commit is contained in:
Monty Taylor 2016-01-19 08:03:57 -05:00
parent f2a57670a7
commit d0854ce5d5
1 changed files with 1 additions and 2 deletions

View File

@ -24,8 +24,7 @@
src: "{{ item }}"
dest: "{{ item }}"
mode: 0600
with_items: hiera_file_paths.paths
when: hiera_file_paths is defined
with_items: hiera_file_paths.paths|default()
- name: ensure hieradata manifest link is present
file: