From dea36ac9d24c1e8cf19f0d27ee49be657d736da6 Mon Sep 17 00:00:00 2001 From: Will Szumski Date: Mon, 14 Oct 2019 10:17:47 +0100 Subject: [PATCH] Fix issue with image download when checksum url is none TASK [image-download : Ensure the image is downloaded] ************************* task path: /home/zuul/kayobe-venv/share/kayobe/ansible/roles/image-download/tasks/main.yml:19 fatal: [localhost]: FAILED! => { "msg": "The field 'vars' has an invalid value, which includes an undefined variable. The error was: 'dict object' has no attribute 'content'\n\nThe error appears to have been in '/home/zuul/kayobe-venv/share/kayobe/ansible/roles/image-download/tasks/main.yml': line 19, column 7, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n - name: Ensure the image is downloaded\n ^ here\n" } to retry, use: --limit @/home/zuul/kayobe-venv/share/kayobe/ansible/kolla-openstack.retry PLAY RECAP ********************************************************************* controller0 : ok=3 changed=0 unreachable=0 failed=0 localhost : ok=6 changed=2 unreachable=0 failed=1 Change-Id: I45fb193b423c7e874aa70cd5f0252e0b0f4e2f05 Story: 2006715 Task: 37086 --- ansible/roles/image-download/tasks/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ansible/roles/image-download/tasks/main.yml b/ansible/roles/image-download/tasks/main.yml index c82345bc2..3f905b8bf 100644 --- a/ansible/roles/image-download/tasks/main.yml +++ b/ansible/roles/image-download/tasks/main.yml @@ -18,7 +18,8 @@ - name: Ensure the image is downloaded vars: - checksum: "{{ image_download_checksum_algorithm }}:{{ expected_checksum.content.split(' ')[0] }}" + # NOTE(wszumski): This is evaluated even when expected_checksum is skipped + checksum: "{{ image_download_checksum_algorithm }}:{{ expected_checksum.content.split(' ')[0] if 'content' in expected_checksum else '' }}" get_url: url: "{{ image_download_url }}" dest: "{{ image_download_dest }}"