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:
parent
f2a57670a7
commit
d0854ce5d5
|
@ -24,8 +24,7 @@
|
||||||
src: "{{ item }}"
|
src: "{{ item }}"
|
||||||
dest: "{{ item }}"
|
dest: "{{ item }}"
|
||||||
mode: 0600
|
mode: 0600
|
||||||
with_items: hiera_file_paths.paths
|
with_items: hiera_file_paths.paths|default()
|
||||||
when: hiera_file_paths is defined
|
|
||||||
|
|
||||||
- name: ensure hieradata manifest link is present
|
- name: ensure hieradata manifest link is present
|
||||||
file:
|
file:
|
||||||
|
|
Loading…
Reference in New Issue