ddelnano / packer-plugin-xenserver

A builder plugin for Packer.IO to support building XenServer images.
Mozilla Public License 2.0
72 stars 37 forks source link

Update the ubuntu example to be resilient to ISO releases #54

Closed ddelnano closed 1 year ago

ddelnano commented 1 year ago

When Ubuntu releases a new ISO, they remove the previous URL. Unfortunately this URL is hardcoded in the packer HCL template and so the example requires frequent changes as upstream releases new minor releases.

This change takes advantage of the packer 1.8 http data source and allows the example to dynamically discover the checksum and URL to use. This will ensure that the example always works, and will prevent friction when new users try out this packer plugin.

Testing

==> xenserver-iso.ubuntu-2004: XAPI client session established ==> xenserver-iso.ubuntu-2004: Retrieving ISO ==> xenserver-iso.ubuntu-2004: Trying https://releases.ubuntu.com/22.04/ubuntu-22.04.2-live-server-amd64.iso ==> xenserver-iso.ubuntu-2004: Trying https://releases.ubuntu.com/22.04/ubuntu-22.04.2-live-server-amd64.iso?checksum=5e38b55d57d94ff029719342357325ed3bda38fa80054f9330dc789cd2d43931 Cancelling build after receiving interrupt ==> xenserver-iso.ubuntu-2004: https://releases.ubuntu.com/22.04/ubuntu-22.04.2-live-server-amd64.iso?checksum=5e38b55d57d94ff029719342357325ed3bda38fa80054f9330dc789cd2d43931 => /home/ddelnano/.cache/packer/c8e223803e24553af3f4bf186c28f2298d18a61a Build 'xenserver-iso.ubuntu-2004' errored after 10 seconds 946 milliseconds: Build was cancelled.

==> Wait completed after 10 seconds 947 milliseconds Cleanly cancelled builds after being interrupted.