From 12195359d10b5ce783ae9664c31eb7a1d047eed2 Mon Sep 17 00:00:00 2001 From: Joshua Rutherford Date: Mon, 14 Oct 2013 13:32:43 -0700 Subject: [PATCH] Allow installation from mirrored repositories RVM's installer now supports the specification of a source repository for installation from non standard locations (i.e., internally hosted repositories). --- manifests/init.pp | 21 +++++++++++++++++---- manifests/system.pp | 11 +++++++---- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 75d2fba4..20889ae0 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -1,10 +1,23 @@ -class rvm($version=undef, $install_rvm=true) { +class rvm( + $version = undef, + $install_rvm = true, + $url = 'https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer', + $source = 'github.com/wayneeseguin/rvm') { + stage { 'rvm-install': before => Stage['main'] } if $install_rvm { - class { - 'rvm::dependencies': stage => 'rvm-install'; - 'rvm::system': stage => 'rvm-install', version => $version; + + class {'rvm::dependencies': + stage => 'rvm-install' } + + class {'rvm::system': + stage => 'rvm-install', + version => $version, + url => $url, + source => $source; + } + } } diff --git a/manifests/system.pp b/manifests/system.pp index ef2cd02a..9f73ea2a 100644 --- a/manifests/system.pp +++ b/manifests/system.pp @@ -1,4 +1,7 @@ -class rvm::system($version=undef) { +class rvm::system( + $version=undef, + $url='https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer', + $source='github.com/wayneeseguin/rvm') { $actual_version = $version ? { undef => 'latest', @@ -8,9 +11,9 @@ exec { 'system-rvm': path => '/usr/bin:/usr/sbin:/bin', - command => "bash -c '/usr/bin/curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer -o /tmp/rvm-installer && \ + command => "bash -c '/usr/bin/curl -s ${url} -o /tmp/rvm-installer && \ chmod +x /tmp/rvm-installer && \ - rvm_bin_path=/usr/local/rvm/bin rvm_man_path=/usr/local/rvm/man /tmp/rvm-installer --version ${actual_version} && \ + rvm_bin_path=/usr/local/rvm/bin rvm_man_path=/usr/local/rvm/man /tmp/rvm-installer --source ${source} --version ${actual_version} && \ rm /tmp/rvm-installer'", creates => '/usr/local/rvm/bin/rvm', require => [ @@ -30,7 +33,7 @@ } -> exec { 'system-rvm-get': path => '/usr/local/rvm/bin:/usr/bin:/usr/sbin:/bin', - command => "rvm get ${version}", + command => "rvm get --source ${source} ${version}", before => Exec['system-rvm'], # so it doesn't run after being installed the first time } }