OLD | NEW |
(Empty) | |
| 1 # == Class: ruby |
| 2 # |
| 3 # Perform a custom Ruby installation based on the ruby-install script, |
| 4 # using /usr/local as installation prefix. |
| 5 # |
| 6 # === Parameters: |
| 7 # |
| 8 # [*version*] |
| 9 # The Ruby version to build and install. |
| 10 # |
| 11 # === Examples: |
| 12 # |
| 13 # class {'ruby': |
| 14 # version => '2.2.0', |
| 15 # } |
| 16 # |
| 17 class ruby( |
| 18 $version = '2.1.5', |
| 19 ) { |
| 20 |
| 21 $install_src_url = 'https://github.com/postmodern/ruby-install.git' |
| 22 $install_src_dir = '/root/ruby-install' |
| 23 $install_command = "$install_src_dir/bin/ruby-install" |
| 24 |
| 25 Exec { |
| 26 logoutput => true, |
| 27 path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', |
| 28 } |
| 29 |
| 30 if !defined(Package['git']) { |
| 31 |
| 32 package {'git': |
| 33 ensure => 'installed', |
| 34 } |
| 35 } |
| 36 |
| 37 exec {'ruby-clone-ruby-install': |
| 38 command => shellquote('git', 'clone', $install_src_url, $install_src_dir), |
| 39 creates => $install_src_dir, |
| 40 require => Package['git'], |
| 41 } |
| 42 -> |
| 43 exec {'ruby-execute-ruby-install': |
| 44 command => shellquote($install_command, '--system', 'ruby', $version), |
| 45 creates => '/usr/local/bin/ruby', |
| 46 } |
| 47 } |
OLD | NEW |