Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: modules/ruby/manifests/init.pp

Issue 5194798336049152: As discussed.. (Closed)
Patch Set: Redmine Evaluation Setup - Various Fixes Created April 30, 2015, 9:33 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: modules/ruby/manifests/init.pp
diff --git a/modules/ruby/manifests/init.pp b/modules/ruby/manifests/init.pp
new file mode 100644
index 0000000000000000000000000000000000000000..ce6031c89082a4159844933ff1bce71660143b07
--- /dev/null
+++ b/modules/ruby/manifests/init.pp
@@ -0,0 +1,47 @@
+# == Class: ruby
+#
+# Perform a custom Ruby installation based on the ruby-install script,
+# using /usr/local as installation prefix.
+#
+# === Parameters:
+#
+# [*version*]
+# The Ruby version to build and install.
+#
+# === Examples:
+#
+# class {'ruby':
+# version => '2.2.0',
+# }
+#
+class ruby(
+ $version = '2.1.5',
+) {
+
+ $install_src_url = 'https://github.com/postmodern/ruby-install.git'
+ $install_src_dir = '/root/ruby-install'
+ $install_command = "$install_src_dir/bin/ruby-install"
+
+ Exec {
+ logoutput => true,
+ path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
+ }
+
+ if !defined(Package['git']) {
+
+ package {'git':
+ ensure => 'installed',
+ }
+ }
+
+ exec {'ruby-clone-ruby-install':
+ command => shellquote('git', 'clone', $install_src_url, $install_src_dir),
+ creates => $install_src_dir,
+ require => Package['git'],
+ }
+ ->
+ exec {'ruby-execute-ruby-install':
+ command => shellquote($install_command, '--system', 'ruby', $version),
+ creates => '/usr/local/bin/ruby',
+ }
+}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld