0

We use Vagrant boxes for development. For every project or small snippet we simply start a new box and provision it with Ansible. This is working fantastic; however, we do get into trouble when connecting to a private Bitbucket repository within a bower install run.

The solution we have now is to generate a new key (ssh-keygen), accept all defaults (pressing <return>, <return>, <return>) and then grab the public key (cat ~/.ssh/id_rsa.pub). Copy it, go to Bitbucket, view your account and add this new ssh key. And repeat for every new box you instantiate.

We have to do this because of some closed source packages (hosted on Bitbucket) we install via Bower. We do have another experience, which is much better: composer (php's package manager) and private Github repositories. With that setup, you have to enter your username/password/2fa token via the command line and an OAuth token is generated for you. This works great.

So, is there a way we can mitigate this bower/bitbucket/ssh issue? For obvious reasons I don't want to provision the boxes with a standard private key, but there has to be another solution?

Jurian Sluiman
  • 13,498
  • 3
  • 67
  • 99

1 Answers1

-1

While I'm not sure that my situation is as complex as yours (I'm not using Ansible or Bower), I solved this problem by using the Vagrant ssh forward agent. This blog post gives you the details on how to get it working:

Cloning from GitHub in Vagrant using SSH agent forwarding

So as long as each of the developers has access on their local machines to the bitbucket repos, it should work.

Nick Burdick
  • 133
  • 6
  • This really might seem the way to fix this issue. I will look into the details of the post and accept your answer if it solves the problem! – Jurian Sluiman Jul 14 '14 at 18:11