Hi, I am having trouble getting a chef to check my git repository using the ssh key from my data_bag.
Below is my git resource:
repo_key = search(:git, "id:git_key").first git_key_file = "#{Chef::Config['file_cache_path']}/git_key/id_rsa" directory "#{Chef::Config['file_cache_path']}/git_key" do action :create end file git_key_file do content repo_key['deploy_key'] mode "0755" action :create_if_missing end git "/usr/share/my_repo" do repository " git@github.com :my_name/some_repo.git" checkout_branch "#{node["my_app"][:test_branch]}" action :sync ssh_wrapper "ssh -i #{git_key_file}" end
When I run: sudo chef-client I get the following error:
STDERR: error: cannot run ssh -i /var/chef/cache/git_key/id_rsa: No such file or directory
I have ssh'ed on the server, and I can verify that the key file is in the right place and contains the key.
git ssh chef
twreid
source share