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

[FEATURE REQUEST] Add ability to provide content directly to floppy_files and http_directory #49

Open BMeach opened 1 year ago

BMeach commented 1 year ago

I dont know how possible this would be but I would really like to be able to provide content directly to the files hosted either in the http_directory setting or the floppy_files setting. Im thinking something very similar to the Packer Builder for VMware vSphere http_content setting for example this works in their config.

  http_content = {
    "/a/b"     = file("http/b")
    "/foo/bar" = templatefile("${path.root}/preseed.cfg", { packages = ["nginx"] })
  }

I would like to be able to create a image per app/env that I have without having to do it in terraform. For example I would like to pass my generated vm name into the user-data file when the image is built so the template images hostname is descriptive and can use variables like the time it was started. Terraform would then take care of changing the hostname per vm when it runs post packer? Is this possible to be implemented or should I look down another road like having a preseed python script that generates the files via j2 or something similar?