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 - Introduce $logoutput Created April 30, 2015, 11:04 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..06809481027f1b2ad7ba6085c71e8c55738ab20e
--- /dev/null
+++ b/modules/ruby/manifests/init.pp
@@ -0,0 +1,55 @@
+# == 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.
+#
+# [*logoutput*]
+# Whether and when to log the output of Exec resources; see
+# https://docs.puppetlabs.com/references/latest/type.html#exec-attribute-logoutput
+#
+# === Examples:
+#
+# class {'ruby':
+# version => '2.2.0',
+# logoutput => true,
+# }
+#
+class ruby(
+ $version = '2.1.5',
+ $logoutput = 'on_failure',
+) {
+
+ $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,
+ logoutput => $logoutput,
+ require => Package['git'],
+ }
+ ->
+ exec {'ruby-execute-ruby-install':
+ command => shellquote($install_command, '--system', 'ruby', $version),
+ creates => '/usr/local/bin/ruby',
+ logoutput => $logoutput,
+ }
+}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld