Interpolating variables in packer web server response

I know you can do something like this: http://{{ .HTTPIP }}:{{ .HTTPPort }}/rhel/8ks.cfg in your boot command to have packer serve up your kickstarts. Is there a way to have packer process the file being sent via its web server and replace variables either with ${var.something} or {{something}}?

Use case: I’m working with Chef’s Bento project, and some when the VMs are built in some hypervisors, they get a hard drive name of /dev/sda but when they build under qemu, they get a device name of /dev/vda. This of course messes up the line in the preseed/kickstart which tells grub where to write the boot loader. Would it be possible to do something like this in the file:

d-i grub-installer/bootdev string /dev/{{install_drive}}

and have the web server replace that value with the variable value?

I looked through the docs, and googled, but didn’t see anything indicating it was possible. I’d rather not duplicate the entire file just to change one value. :slight_smile:

Thanks for any tips or tricks!