Created
July 20, 2011 18:29
-
-
Save bartiaco/1095567 to your computer and use it in GitHub Desktop.
Chef recipe for using private gem repositories in github, from engineyard appcloud
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | |
| # 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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