From d2731fe8838bd1386e0d6802ceebd020c2c8ad9a Mon Sep 17 00:00:00 2001 From: Chris Date: Fri, 31 Jul 2015 15:19:13 +0200 Subject: [PATCH] Added an exec to import RVM GPG key if it does not already exist for that user --- manifests/install.pp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/manifests/install.pp b/manifests/install.pp index 661430c..0f540f0 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -87,13 +87,17 @@ } require single_user_rvm::dependencies - + $import_key = "curl -sSL https://rvm.io/mpapis.asc | su -c 'gpg2 --import -' ${user}" $install_command = "su -c 'curl -L https://get.rvm.io | bash -s ${version}' - ${user}" - + + exec { $import_key: + path => '/usr/bin:/usr/sbin:/bin', + onlyif => "test `gpg --list-keys | grep 'RVM signing' | wc -l` -eq 0" + } exec { $install_command: path => '/usr/bin:/usr/sbin:/bin', creates => "${homedir}/.rvm/bin/rvm", - require => [ Package['curl'], Package['bash'], User[$user] ], + require => [ Package['curl'], Package['bash'], User[$user], Exec[$import_key] ], } $rvm_executable = "${homedir}/.rvm/bin/rvm"