-
-
Save cwjohnston/1042983 to your computer and use it in GitHub Desktop.
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
define :github, :user => "root", :home => "/root", :group => "" do | |
package "git-core" | |
group = params[:group].empty? ? params[:user] : params[:group] | |
directory "#{params[:home]}/.ssh" do | |
mode "0700" | |
owner params[:user] | |
group group | |
recursive true | |
end | |
cookbook_file "#{params[:home]}/.ssh/github" do | |
source "github-ssh-key" | |
mode "0600" | |
owner params[:user] | |
group group | |
end | |
file "#{params[:home]}/.ssh/config" do | |
owner params[:user] | |
group group | |
content <<-EOH | |
Host github.com | |
IdentityFile ~/.ssh/github | |
IdentitiesOnly yes | |
StrictHostKeyChecking no | |
EOH | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment