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
This commit is contained in:
Will Szumski 2019-10-14 10:17:47 +01:00
parent c620dd84f7
commit dea36ac9d2

View File

@ -18,7 +18,8 @@
- name: Ensure the image is downloaded - name: Ensure the image is downloaded
vars: 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: get_url:
url: "{{ image_download_url }}" url: "{{ image_download_url }}"
dest: "{{ image_download_dest }}" dest: "{{ image_download_dest }}"