How to have vagrant pull from a private git repo?

743 views
Skip to first unread message

Paul C

unread,
Jan 14, 2014, 9:15:10 PM1/14/14
to vagra...@googlegroups.com
Im provisioning using shell scripts at the moment, as I haven;t yet had time to look into Chef/Puppet (not that Im convinced they would help my problem)

As part of my provisioning, I want to pull a private git repository from my github account.

Clearly this needs an ssh key which is already authorised on github, so Im faced with either:
- Adding a new key manually to github each time I want to provision a new vm
- Have the vagrant vm copy the public key from the host machine, and use that to authenticate with github

Neither is ideal, although since these vm's will not be shared publicly, the latter sounds vaguely acceptable.

Just wondering if this is a common problem, and how other people have tackled it?

Thankyou

Teto

unread,
Jan 15, 2014, 11:48:14 AM1/15/14
to vagra...@googlegroups.com
You need to upload the private key (the public one being on github) to the VM.

I guess I would pull from the host into an host folder shared with a VM.

Good luck

2014/1/15 Paul C <p.chap...@gmail.com>:
> --
> You received this message because you are subscribed to the Google Groups
> "Vagrant" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to vagrant-up+...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

Paul C

unread,
Jan 15, 2014, 5:38:25 PM1/15/14
to vagra...@googlegroups.com, matt...@gmail.com
I've since found its theoretically possible to use ssh-agent forwarding, so the vagrant box has access to your ssh key

config.ssh.private_key_path = "~/.ssh/id_rsa"
config.ssh.forward_agent = true

So far though, I've yet to get this working
vagrant cannot ssh into the box at all during 'vagrant up' when I've enabled agent forwarding


Reply all
Reply to author
Forward
0 new messages