diff --git a/attributes/default.rb b/attributes/default.rb index fb025e63..41ba6ded 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -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} diff --git a/recipes/system_install.rb b/recipes/system_install.rb index 234da352..d41117a0 100644 --- a/recipes/system_install.rb +++ b/recipes/system_install.rb @@ -30,4 +30,10 @@ g.run_action(:create) end +execute 'Adding gpg key' do + command "`which gpg2 || which gpg` --keyserver hkp://keys.gnupg.net --recv-keys #{node['rvm']['gpg_key']}" + only_if 'which gpg2 || which gpg' + not_if { node['rvm']['gpg_key'].empty? } +end + rvm_installation("root")