Packer custom plugin: How to retrieve connection information?

20 views
Skip to first unread message

Ronald van Zantvoort

unread,
Sep 15, 2016, 8:14:43 AM9/15/16
to Packer
hi all! I'm building a new Packer provisioner plugin, and I need access to the VM's SSH connection *settings* (I'm invoking a program that does SSH itself). I can't however for the life figure out how to get to that info :( Anybody an idea?

Alvaro Miranda Aguilera

unread,
Sep 15, 2016, 8:49:27 AM9/15/16
to packe...@googlegroups.com

On Thu, Sep 15, 2016 at 2:14 PM, Ronald van Zantvoort <the....@gmail.com> wrote:
hi all! I'm building a new Packer provisioner plugin, and I need access to the VM's SSH connection *settings* (I'm invoking a program that does SSH itself). I can't however for the life figure out how to get to that info :( Anybody an idea?

--
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 packer-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/e54cf12a-0158-4318-a3f5-128e65140e23%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Ronald van Zantvoort

unread,
Sep 15, 2016, 9:20:42 AM9/15/16
to Packer
Hi Alvaro, thanks for responding. 

I'm not sure I'm following though; although I'm very new at all this, the code you point seems to be a Packer-internal RPC client for the Server I'm supposed to start in main.go, correct? 
How would that get me say 'ssh_username' ? 

Rickard von Essen

unread,
Sep 15, 2016, 1:52:50 PM9/15/16
to packe...@googlegroups.com

Actually it's not possible. The communicator hides this information and also support a more sofisticated setup than just ssh user@host:port.

I recommend that you look at how the ansible (remote) provisioner tackles this by running it's own ssh proxy. This required alot of implementation by the author and might be a bit difficult to mimic. Or if you are lucky you can just duplicate that code.

/ Rickard


Ronald van Zantvoort

unread,
Sep 15, 2016, 4:27:23 PM9/15/16
to Packer
Thanks for the answer, I've started https://github.com/mitchellh/packer/issues/3889


Reply all
Reply to author
Forward
0 new messages