shaunduncan / packer-provisioner-host-command

Packer plugin to run shell like provisioning on the host machine
MIT License
35 stars 5 forks source link

SSH info as environment variables? #1

Open jantman opened 10 years ago

jantman commented 10 years ago

Not sure how feasible this is, but is it possible to have as much of the SSH connection information (host, port, user, keys/password) as possible exposed as environment variables for the commands that are run? I don't Go, so I'm not sure how big of a task that is...

shaunduncan commented 10 years ago

Are you meaning the builder config settings for ssh_username and ssh_password? If so, what kind of naming do you think would work best for these env vars?

jantman commented 10 years ago

Yeah I guess... as well as the SSH host and port... essentially everything I'd need to SSH to the host from within the command.

Naming... PACKERSSH* ?

On Mon, Aug 4, 2014 at 8:27 AM, Shaun Duncan notifications@github.com wrote:

Are you meaning the builder config settings for ssh_username and ssh_password? If so, what kind of naming do you think would work best for these env vars?

— Reply to this email directly or view it on GitHub https://github.com/shaunduncan/packer-provisioner-host-command/issues/1#issuecomment-51053157 .

shaunduncan commented 10 years ago

Ok, let me see what I can come up with

yuku commented 9 years ago

:+1: I also need this feature to run capistrano.

And this may solve mitchellh/packer#770

wuxxin commented 9 years ago

+1 for piping in a luks full disk encryption key via ssh

jszwedko commented 9 years ago

:+1: for this to run serverspec locally

jantman commented 9 years ago

So... I really don't know Go at all. What I can find, via the current master branch of Packer, is that the provisioners take a packer.Communicator parameter (at least for SSH) that stores the address and a config struct that includes the SSH client config. The part that I'm unsure about is how to access these variables...