Last active
August 29, 2015 14:04
-
-
Save stefhen/53dfe42db6d6172ad081 to your computer and use it in GitHub Desktop.
Git clone with Chef and ssh
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
| # 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 |
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
| #!/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