I'm following the very common pattern of using "http_directory" in a packer builder, to serve up a CentOS kickstart file. Like this:
"boot_command": [
"<tab> text ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ks.cfg<enter><wait>"
],
"http_directory": "http",
My question: Can I put other files into the http folder, and access them from my shell provisioning scripts?
Assuming that the http server is still running during the provisioning step, everything seems to hinge on getting the values of HTTPIP and HTTPPort into the running script. I'm having no luck so far. I export .Vars into my provisioner as described in the docs, but alas, it's not working. This is what I have in my packer file:
"override": {
"vmware-iso": {
"execute_command": "echo 'packer' | {{ .Vars }} sudo -E -S sh '{{ .Path }}'"
}
},
Then I do this in my script:
wget -P /tmp http://${HTTPIP}:${HTTPPort}/file.txt
Any suggestions appreciated! Cheers,
Paul