Skip to content

Instantly share code, notes, and snippets.

@bartiaco
Created July 20, 2011 18:29
Show Gist options
  • Select an option

  • Save bartiaco/1095567 to your computer and use it in GitHub Desktop.

Select an option

Save bartiaco/1095567 to your computer and use it in GitHub Desktop.
Chef recipe for using private gem repositories in github, from engineyard appcloud
#
# Cookbook Name:: github_key
# Recipe:: default
#
ey_cloud_report "github_key" do
message "Running Custom Github SSH Key Chef Configuration"
end
# loop over all application instances
node[:applications].each do |app_name,data|
user = node[:users].first
identity = "/home/deploy/.ssh/#{app_name}-deploy-key"
puts identity
case node[:instance_role]
when "solo", "app", "app_master"
template "/root/.ssh/config" do
source "sshconfig.erb"
owner "root"
group "root"
mode 0744
variables({
:identity => identity
})
end
template "/home/deploy/.ssh/config" do
source "sshconfig.erb"
owner "deploy"
group "deploy"
mode 0744
variables({
:identity => identity
})
end
end
end
Host github.com
User git
Hostname github.com
PreferredAuthentications publickey
IdentityFile <%= @identity %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment