{"action":"created","issue":{"url":"https://api.github.com/repos/fnichol/chef-rvm/issues/288","labels_url":"https://api.github.com/repos/fnichol/chef-rvm/issues/288/labels{/name}","comments_url":"https://api.github.com/repos/fnichol/chef-rvm/issues/288/comments","events_url":"https://api.github.com/repos/fnichol/chef-rvm/issues/288/events","html_url":"https://github.com/fnichol/chef-rvm/issues/288","id":53328772,"number":288,"title":"GPG check for user install","user":{"login":"lemattma","id":385858,"avatar_url":"https://avatars.githubusercontent.com/u/385858?v=3","gravatar_id":"","url":"https://api.github.com/users/lemattma","html_url":"https://github.com/lemattma","followers_url":"https://api.github.com/users/lemattma/followers","following_url":"https://api.github.com/users/lemattma/following{/other_user}","gists_url":"https://api.github.com/users/lemattma/gists{/gist_id}","starred_url":"https://api.github.com/users/lemattma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lemattma/subscriptions","organizations_url":"https://api.github.com/users/lemattma/orgs","repos_url":"https://api.github.com/users/lemattma/repos","events_url":"https://api.github.com/users/lemattma/events{/privacy}","received_events_url":"https://api.github.com/users/lemattma/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-01-04T07:38:57Z","updated_at":"2015-01-06T02:03:14Z","closed_at":null,"body":"Hey everyone!\r\n\r\nI realised the gpg command was [added](https://github.com/fnichol/chef-rvm/blob/master/recipes/system_install.rb) for system installs, any reason for not adding it to user installs?\r\n\r\nI ended up doing the following to fix the gpg error:\r\n\r\n```ruby\r\ngnupg_dir       = \"/home/#{node[:user][:name]}/.gnupg\"\r\ngnupg_dir_user  = \"chown -R #{node[:user][:name]}:#{node[:user][:group]} #{gnupg_dir};\"\r\ngnupg_dir_root  = \"if [ -d #{gnupg_dir} ]; then chown -R root:root #{gnupg_dir}; fi;\"\r\ngnupg_cmd       = \"`which gpg2 || which gpg` --keyserver hkp://keys.gnupg.net --recv-keys #{node['rvm']['gpg_key']};\"\r\n\r\nexecute \"Adding gpg key to #{node[:user][:name]}\" do\r\n  environment ({\"HOME\" => \"/home/#{node[:user][:name]}\"})\r\n  command \"#{gnupg_dir_root} #{gnupg_cmd} #{gnupg_dir_user}\"\r\n  not_if { node['rvm']['gpg_key'].empty? }\r\n  returns 0\r\nend\r\n```\r\n\r\nNot the best code, but it's working for now :smile: \r\n\r\nI had to change the ownership because the keys are added as root and they need to belong to each user to pass the check. I tried to run the `execute` using the `user` attribute, but it didn't work either. If they already exist, they have to belong to root again other wise you get a security warning and the recipe fails.\r\n\r\nAny better ideas for this?\r\nWill you add a workaround for user installs soon?\r\n\r\nBest,\r\nMartin"},"comment":{"url":"https://api.github.com/repos/fnichol/chef-rvm/issues/comments/68815542","html_url":"https://github.com/fnichol/chef-rvm/issues/288#issuecomment-68815542","issue_url":"https://api.github.com/repos/fnichol/chef-rvm/issues/288","id":68815542,"user":{"login":"lemattma","id":385858,"avatar_url":"https://avatars.githubusercontent.com/u/385858?v=3","gravatar_id":"","url":"https://api.github.com/users/lemattma","html_url":"https://github.com/lemattma","followers_url":"https://api.github.com/users/lemattma/followers","following_url":"https://api.github.com/users/lemattma/following{/other_user}","gists_url":"https://api.github.com/users/lemattma/gists{/gist_id}","starred_url":"https://api.github.com/users/lemattma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lemattma/subscriptions","organizations_url":"https://api.github.com/users/lemattma/orgs","repos_url":"https://api.github.com/users/lemattma/repos","events_url":"https://api.github.com/users/lemattma/events{/privacy}","received_events_url":"https://api.github.com/users/lemattma/received_events","type":"User","site_admin":false},"created_at":"2015-01-06T02:03:14Z","updated_at":"2015-01-06T02:03:14Z","body":"@akshah123 I tried that but it didn't work, I'll try again and will let you know what I find."}}