[chef] Re: Deploy from github, using individual keys


Chronological Thread 
  • From: Matthew Moretti < >
  • To:
  • Subject: [chef] Re: Deploy from github, using individual keys
  • Date: Thu, 27 Jun 2013 11:03:29 -0400

I haven't tried this, but you can specify JSON data in your Vagrantfile.

If your deploy process gets your deploy key from an attribute, you can override that in the Vagrantfile. And, since a Vagrantfile is just ruby, you could get that key from just reading in a user's SSH public key file.

Something like

Vagrant.configure("2") do |config|
  config.vm.provision "chef_server" do |chef|
    # ...

    chef.json = {
      "myapp" => {
        "deploy_key" => File.read(ENV['MYORG_DEPLOY_KEY'] || "#{ENV['HOME']}/.ssh/id_rsa.pub")
      }
    }
  end
end

Maybe?

-Matt Moretti



On Thu, Jun 27, 2013 at 8:10 AM, Mike < " target="_blank"> > wrote:
I feel like this has been done, demonstrated, but I couldn't find
anything on it.

Flow:

Provision a box
At some point in the run, pull a branch from github (master, tag, etc)
Restart service if changed

By using a GitHub deploy key, I can automate this for prod, sure.

But if I'm using Vagrant, and I want to restrict access to the deploy
key, is there a known way for me to specify "use a user's ssh-agent
forwarded ssh key instead".

Ideas, blogs, thoughts?
-M




Archive powered by MHonArc 2.6.16.

§