add conditions to check if stdout or stdout_lines is empty
parent
21c373d914
commit
7ba6750fd5
|
@ -35,6 +35,7 @@
|
|||
with_items: "{{ (node_images_raw.stdout | from_json).images }}"
|
||||
when:
|
||||
- image_command_tool == 'crictl'
|
||||
- node_images_raw.stdout != ''
|
||||
# In case of nerdctl or docker, the output is already in the expected format
|
||||
# {"Digest":"sha256:847423221ed040798e47df36450edce5581ed642cd087ccb210532764da38b23","Repository":"quay.io/coreos/etcd","Tag":"v3.5.12"}
|
||||
# {"Digest":"sha256:34fc87c4a60c0b3ba3b3608871f4494de8072c02808a4151953068f2d7c87743","Repository":"flannel/flannel","Tag":"latest"}
|
||||
|
@ -43,6 +44,7 @@
|
|||
node_images: "{{ node_images_raw.stdout_lines | map('from_json') | list }}"
|
||||
when:
|
||||
- image_command_tool in ['nerdctl', 'docker']
|
||||
- when node_images_raw.stdout_lines != ''
|
||||
|
||||
- name: Show node images
|
||||
debug:
|
||||
|
|
Loading…
Reference in New Issue