You can do something like this:

"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".

You just need to switch to ifconfig etc. If you are building in a cloud it
might also be possible to use the cli/api if you have an unique name/id/tag
etc to lookup.


On Jun 22, 2017 17:27, "James Elmes" <[email protected]> wrote:

Howdy.

Wondering if there is a way to return the guest IP. I want to initiate a
file copy from Shell-Local provisioner, this way the copy is initiated from
the local machine running packer.

example: xcopy -source C:\packer\vmtools -destination \\guestip\c$\packer

i have looked everywhere and can't seem to find a way to return the actual
guest IP

any help appreciated

James

-- 
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/0db28607-448b-4bf7-b2ec-8aa4a72272ab%40googlegroups.com
<https://groups.google.com/d/msgid/packer-tool/0db28607-448b-4bf7-b2ec-8aa4a72272ab%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/CALz9Rt8fjRbad4LnOmPY-%2BFypO%3DxXrVan_KZYPFdvK9gquzs9g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to