Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use GPG for rvm verification. #285

Merged
merged 3 commits into from
Dec 20, 2014
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@
default['rvm']['group_id'] = 'default'
default['rvm']['group_users'] = []

# GPG key for rvm verification
default['rvm']['gpg_key'] = 'D39DC0E3'

case platform
when "redhat","centos","fedora","scientific","amazon"
node.set['rvm']['install_pkgs'] = %w{sed grep tar gzip bzip2 bash curl git}
Expand Down
6 changes: 6 additions & 0 deletions recipes/system_install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,10 @@
g.run_action(:create)
end

execute 'Adding gpg key' do
command "gpg --keyserver hkp://keys.gnupg.net --recv-keys #{node['rvm']['gpg_key']}"
only_if 'which gpg || which gpg2'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with this check you need to change the command to something like:

"`which gpg || which gpg2` --keyserver hkp://keys.gnupg.net --recv-keys #{node['rvm']['gpg_key']}"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also in RVM the check order is reversed to which gpg2 || which gpg - although they are supposed to be compatible the v2 might be safer one day

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah right, duh, thanks.

not_if { node['rvm']['gpg_key'].empty? }
end

rvm_installation("root")