{"action":"created","issue":{"url":"https://api.github.com/repos/matschaffer/knife-solo/issues/461","labels_url":"https://api.github.com/repos/matschaffer/knife-solo/issues/461/labels{/name}","comments_url":"https://api.github.com/repos/matschaffer/knife-solo/issues/461/comments","events_url":"https://api.github.com/repos/matschaffer/knife-solo/issues/461/events","html_url":"https://github.com/matschaffer/knife-solo/issues/461","id":113283186,"number":461,"title":"knife-solo and data bag encryption","user":{"login":"rajanshah","id":1548345,"avatar_url":"https://avatars.githubusercontent.com/u/1548345?v=3","gravatar_id":"","url":"https://api.github.com/users/rajanshah","html_url":"https://github.com/rajanshah","followers_url":"https://api.github.com/users/rajanshah/followers","following_url":"https://api.github.com/users/rajanshah/following{/other_user}","gists_url":"https://api.github.com/users/rajanshah/gists{/gist_id}","starred_url":"https://api.github.com/users/rajanshah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rajanshah/subscriptions","organizations_url":"https://api.github.com/users/rajanshah/orgs","repos_url":"https://api.github.com/users/rajanshah/repos","events_url":"https://api.github.com/users/rajanshah/events{/privacy}","received_events_url":"https://api.github.com/users/rajanshah/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-10-26T04:22:22Z","updated_at":"2015-10-26T15:00:51Z","closed_at":null,"body":"Hi,\r\n\r\nAgain this has nothing to do with knife-solo issue, but it has to be my understanding. At the same time, it would be great if someone can assist with following issue.\r\n\r\nI am trying to clone private repo using chef-solo and have following setup.\r\n\r\n1. Create a file\r\nEDITOR=vim knife solo data bag create test_key project\r\n\r\n2. Get private key and remove new line\r\na. pbcopy <  ~/.ssh/id_rsa\r\nb. vi /tmp/test.key \r\nc. paste the key\r\nd. remove new line via :%s/\\n/\\\\n/\r\ne. copy it to test_key file, so now it will look like as follows:\r\n{ “id”: “project”,\r\n   “test_key”: <Private key>\r\n}\r\n\r\n3. It correctly creates data bag and I can see it\r\na. knife solo data bag show secrets <app_name>    \r\nb. knife solo data bag show secrets <app_name> --secret-file  ~/.chef/encrypted_data_bag_secret\r\n\r\n4. Cloning a private repo\r\n\r\n- attributes\r\ndefault[:test][:base]  = \"/home/ubuntu\"  \r\ndefault[:test][:log_dir] = \"/var/log/test\"  \r\ndefault[:test][:loglevel]   = \"info\" \r\ndefault[:test][:user]       = \"ubuntu\"  \r\n\r\ndefault[:test][:deploy_repo] = \"git@github.com:test/test.git\"  \r\ndefault[:test][:deploy_branch] = \"master\"  \r\ndefault[:test][:deploy_dir] = \"/srv/test\"\r\n\r\n- recipes\r\ngit \"#{node[:test][:base]}/test\" do\r\n    repository \"git@github.test/test.git\"\r\n    reference \"master\"\r\n    action :sync\r\n    destination \"node[:test][:base]/test\"\r\n    user \"#{node[:test][:user]}\"\r\n    group \"#{node[:test][:user]}\"\r\n    ssh_wrapper \"#{node[:test][:base]}/.ssh/git-ssh-wrapper.sh\"\r\n    timeout 300\r\nend\r\n\r\nCouple observations:\r\n\r\n1. Upon running the script, it generates decrypted private key file in ~/.ssh on server. It matches ditto with  unencrypted key on client.\r\n\r\n2. The above code gets stuck in \"sync\" step and generates error pertaining to \"git ls-remote\".\r\n\r\nI would appreciate, if one suggests hint or suggestions on \"what could be wrong\" and ways to resolve it."},"comment":{"url":"https://api.github.com/repos/matschaffer/knife-solo/issues/comments/151165893","html_url":"https://github.com/matschaffer/knife-solo/issues/461#issuecomment-151165893","issue_url":"https://api.github.com/repos/matschaffer/knife-solo/issues/461","id":151165893,"user":{"login":"rajanshah","id":1548345,"avatar_url":"https://avatars.githubusercontent.com/u/1548345?v=3","gravatar_id":"","url":"https://api.github.com/users/rajanshah","html_url":"https://github.com/rajanshah","followers_url":"https://api.github.com/users/rajanshah/followers","following_url":"https://api.github.com/users/rajanshah/following{/other_user}","gists_url":"https://api.github.com/users/rajanshah/gists{/gist_id}","starred_url":"https://api.github.com/users/rajanshah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rajanshah/subscriptions","organizations_url":"https://api.github.com/users/rajanshah/orgs","repos_url":"https://api.github.com/users/rajanshah/repos","events_url":"https://api.github.com/users/rajanshah/events{/privacy}","received_events_url":"https://api.github.com/users/rajanshah/received_events","type":"User","site_admin":false},"created_at":"2015-10-26T15:00:51Z","updated_at":"2015-10-26T15:00:51Z","body":"It got resolved, I had password on my private key and expected it to work.\r\n\r\nNow, the question is: \r\n\r\nWhat's the preferred approach for automated deployment keys for github?\r\na. password-less\r\nb. with password \r\n\r\nThe follow-up question is, if it's option b. how one can supply passphrase to deployment key while performing automated deployment via chef."}}