diff --git a/playbooks/roles/bifrost-ironic-install/defaults/main.yml b/playbooks/roles/bifrost-ironic-install/defaults/main.yml index 378876e59..950ada972 100644 --- a/playbooks/roles/bifrost-ironic-install/defaults/main.yml +++ b/playbooks/roles/bifrost-ironic-install/defaults/main.yml @@ -40,14 +40,15 @@ ans_network_interface: "{{ network_interface | replace('-', '_') }}" # documentation at http://ipxe.org/crypto ipa_file_protocol: "http" +ipa_upstream_release: "master" ipa_kernel: "{{http_boot_folder}}/ipa.vmlinuz" ipa_ramdisk: "{{http_boot_folder}}/ipa.initramfs" ipa_kernel_url: "{{ ipa_file_protocol }}://{{ hostvars[inventory_hostname]['ansible_' + ans_network_interface]['ipv4']['address'] }}:{{file_url_port}}/ipa.vmlinuz" -ipa_kernel_upstream_url: https://tarballs.openstack.org/ironic-python-agent/tinyipa/files/tinyipa-master.vmlinuz +ipa_kernel_upstream_url: "https://tarballs.openstack.org/ironic-python-agent/tinyipa/files/tinyipa-{{ ipa_upstream_release }}.vmlinuz" ipa_kernel_upstream_checksum_algo: "sha256" ipa_kernel_upstream_checksum_url: "{{ ipa_kernel_upstream_url }}.{{ ipa_kernel_upstream_checksum_algo }}" ipa_ramdisk_url: "{{ ipa_file_protocol }}://{{ hostvars[inventory_hostname]['ansible_' + ans_network_interface]['ipv4']['address'] }}:{{file_url_port}}/ipa.initramfs" -ipa_ramdisk_upstream_url: https://tarballs.openstack.org/ironic-python-agent/tinyipa/files/tinyipa-master.gz +ipa_ramdisk_upstream_url: "https://tarballs.openstack.org/ironic-python-agent/tinyipa/files/tinyipa-{{ ipa_upstream_release }}.gz" ipa_ramdisk_upstream_checksum_algo: "sha256" ipa_ramdisk_upstream_checksum_url: "{{ ipa_ramdisk_upstream_url }}.{{ ipa_ramdisk_upstream_checksum_algo }}" deploy_image_filename: "deployment_image.qcow2" diff --git a/playbooks/roles/bifrost-ironic-install/tasks/download_ipa_image.yml b/playbooks/roles/bifrost-ironic-install/tasks/download_ipa_image.yml index e946c8289..fde8236c5 100644 --- a/playbooks/roles/bifrost-ironic-install/tasks/download_ipa_image.yml +++ b/playbooks/roles/bifrost-ironic-install/tasks/download_ipa_image.yml @@ -22,14 +22,23 @@ - block: - name: "Download IPA kernel checksum file" get_url: url="{{ ipa_kernel_upstream_checksum_url }}" dest="{{ ipa_kernel }}.{{ ipa_kernel_upstream_checksum_algo }}" timeout=300 + register: ipa_kernel_checksum_result + ignore_errors: yes + - debug: msg="WARNING!!! {{ ipa_kernel_upstream_checksum_algo }} file not found at {{ ipa_kernel_upstream_checksum_url }}" + when: ipa_kernel_checksum_result is defined and ipa_kernel_checksum_result.status_code is defined and ipa_kernel_checksum_result.status_code == 404 + - fail: msg="FATAL {{ ipa_kernel_upstream_checksum_algo }} file not found at {{ ipa_kernel_upstream_checksum_url }} GOT {{ ipa_kernel_checksum_result }}" + when: ipa_kernel_checksum_result is not defined or ipa_kernel_checksum_result.changed is not defined or + (ipa_kernel_checksum_result.changed and ipa_kernel_checksum_result.status_code != 404 and ipa_kernel_checksum_result.status_code != 200) - name: "Extract IPA kernel checksum" shell: awk '/{{ ipa_kernel_upstream_url | basename }}/{print $1}' "{{ ipa_kernel }}.{{ ipa_kernel_upstream_checksum_algo }}" register: parsed_ipa_kernel_checksum + when: not ipa_kernel_checksum_result|failed - fail: msg: "Failed to extract checksum for {{ ipa_kernel_upstream_url | basename }}" - when: parsed_ipa_kernel_checksum.stdout == "" + when: not ipa_kernel_checksum_result|failed and parsed_ipa_kernel_checksum.stdout == "" - set_fact: ipa_kernel_checksum: "{{ ipa_kernel_upstream_checksum_algo }}:{{ parsed_ipa_kernel_checksum.stdout }}" + when: not ipa_kernel_checksum_result|failed when: ipa_kernel_upstream_checksum_url != "" - name: "Download IPA kernel" @@ -41,7 +50,8 @@ # Keep downloading it until we get a good copy force: yes register: ipa_kernel_download_done - until: ipa_kernel_download_done|succeeded + until: ipa_kernel_download_done|succeeded or + (ipa_kernel_download_done|failed and ipa_kernel_download_done.status_code == 404) retries: 5 delay: 10 when: test_ipa_kernel_present.stat.exists == false @@ -53,14 +63,23 @@ - block: - name: "Download IPA image checksum" get_url: url="{{ ipa_ramdisk_upstream_checksum_url }}" dest="{{ ipa_ramdisk }}.{{ ipa_ramdisk_upstream_checksum_algo }}" timeout=300 + register: ipa_ramdisk_checksum_result + ignore_errors: yes + - debug: msg="WARNING!!! {{ ipa_ramdisk_upstream_checksum_algo }} file not found at {{ ipa_ramdisk_upstream_checksum_url }}" + when: ipa_ramdisk_checksum_result is defined and ipa_ramdisk_checksum_result.status_code is defined and ipa_ramdisk_checksum_result.status_code == 404 + - fail: msg="FATAL {{ ipa_ramdisk_upstream_checksum_algo }} file not found at {{ ipa_ramdisk_upstream_checksum_url }}" + when: ipa_ramdisk_checksum_result is not defined or ipa_ramdisk_checksum_result.changed is not defined or + (ipa_ramdisk_checksum_result.changed and ipa_ramdisk_checksum_result.status_code != 404 and ipa_ramdisk_checksum_result.status_code != 200) - name: "Extract IPA ramdisk checksum" shell: awk '/{{ ipa_ramdisk_upstream_url | basename }}/{print $1}' "{{ ipa_ramdisk }}.{{ ipa_ramdisk_upstream_checksum_algo }}" register: parsed_ipa_ramdisk_checksum + when: not ipa_ramdisk_checksum_result|failed - fail: msg: "Failed to extract checksum for {{ ipa_ramdisk_upstream_url | basename }}" - when: parsed_ipa_ramdisk_checksum.stdout == "" + when: not ipa_ramdisk_checksum_result|failed and parsed_ipa_ramdisk_checksum.stdout == "" - set_fact: ipa_ramdisk_checksum: "{{ ipa_ramdisk_upstream_checksum_algo }}:{{ parsed_ipa_ramdisk_checksum.stdout }}" + when: not ipa_ramdisk_checksum_result|failed when: ipa_ramdisk_upstream_checksum_url != "" - name: "Download IPA image" @@ -72,7 +91,8 @@ # Keep downloading it until we get a good copy force: yes register: ipa_ramdisk_download_done - until: ipa_ramdisk_download_done|succeeded + until: ipa_ramdisk_download_done|succeeded or + (ipa_ramdisk_download_done|failed and ipa_ramdisk_download_done.status_code == 404) retries: 5 delay: 10 when: test_ipa_image_present.stat.exists == false diff --git a/releasenotes/notes/change-ipa-version-cacaec52a55188cc.yaml b/releasenotes/notes/change-ipa-version-cacaec52a55188cc.yaml new file mode 100644 index 000000000..41a3e44d8 --- /dev/null +++ b/releasenotes/notes/change-ipa-version-cacaec52a55188cc.yaml @@ -0,0 +1,12 @@ +--- +features: + - | + By adding extra variable ``-e ipa_upstream_release=stable-mitaka`` for instance, + the deployment can now use all ramdisk and kernel images available in + https://tarballs.openstack.org/ironic-python-agent/tinyipa/files/ + instead of the default ``master``. + + Furthermore, as some of these files do not have any .sha256 + checksum associated to them, the downloading of these file + is now just issuing a "warning" and is not reported as an + Ansible error in the final summary.