Skip to content

Instantly share code, notes, and snippets.

@stefhen
Last active August 29, 2015 14:04
Show Gist options
  • Select an option

  • Save stefhen/53dfe42db6d6172ad081 to your computer and use it in GitHub Desktop.

Select an option

Save stefhen/53dfe42db6d6172ad081 to your computer and use it in GitHub Desktop.
Git clone with Chef and ssh
# Install private key for git pull
file "/root/.ssh/git_ssh_key" do
content node[:ssh_key][:attribute]
mode "0400"
owner "root"
group "root"
end
git "/path/to/repo" do
repository "git://github.com/path/repo.git"
revision "master"
action :sync
ssh_wrapper "/root/.ssh/wrapper.sh"
end
#!/bin/sh
exec ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i "/root/.ssh/git_ssh_key" "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment