I'm not sure why you need the hostname?
But if you need to get that to the machine running Packer you can do
something like:
"provisioners": [
{
"type": "shell",
"inline": [ "hostname > /tmp/hostname" ]
},
{
"type": "file",
"direction": "download",
"source": "/tmp/hostname",
"destination": "hostname"
}
]
And you will get the hostname in the file "hostname".
On 2 June 2017 at 14:25, <[email protected]> wrote:
> I am wanting to run some serverspec tests against my vagrant box but i'm
> not really sure how to get the virtualmachines hostname from packer or how
> to configure a hostname. Anyone know if this i possible?
>
> --
> This mailing list is governed under the HashiCorp Community Guidelines -
> https://www.hashicorp.com/community-guidelines.html. Behavior in
> violation of those guidelines may result in your removal from this mailing
> list.
>
> GitHub Issues: https://github.com/mitchellh/packer/issues
> IRC: #packer-tool on Freenode
> ---
> You received this message because you are subscribed to the Google Groups
> "Packer" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/packer-tool/4328edb6-bd18-40b6-81f3-73f9aa61fd4a%40googlegroups.com
> <https://groups.google.com/d/msgid/packer-tool/4328edb6-bd18-40b6-81f3-73f9aa61fd4a%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
This mailing list is governed under the HashiCorp Community Guidelines -
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of
those guidelines may result in your removal from this mailing list.
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups
"Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/packer-tool/CALz9Rt8ONRFcer%3DL7C7Eg_xgKknARqV5Xjjy3A%2BLMKYZ%3DT7xdw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.