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 clone and build. |
| 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 $ruby_install_source_url = 'https://github.com/postmodern/ruby-install.git' |
| 22 $ruby_install_source_dir = "/root/ruby-install" |
| 23 |
| 24 Package { |
| 25 ensure => 'installed', |
| 26 } |
| 27 |
| 28 Exec { |
| 29 logoutput => true, |
| 30 path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', |
| 31 } |
| 32 |
| 33 if !defined(Package['git']) { |
| 34 package {'git': } |
| 35 } |
| 36 |
| 37 exec {'ruby-clone-ruby-install': |
| 38 command => shellquote('git', 'clone', $ruby_install_source_url, $ruby_instal
l_source_dir), |
| 39 creates => $ruby_install_source_dir, |
| 40 } |
| 41 -> |
| 42 exec {'ruby-execute-ruby-install': |
| 43 command => shellquote("$ruby_install_source_dir/bin/ruby-install", '--system
', 'ruby', $ruby_version), |
| 44 creates => "/usr/local/bin/ruby", |
| 45 } |
| 46 |
| 47 Exec['ruby-clone-ruby-install'] <- Package['git'] |
| 48 } |
OLD | NEW |