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

Unified Diff: modules/nodejs/manifests/package.pp

Issue 29483578: #2007 - Introduce nodejs module (Closed)
Patch Set: Created July 9, 2017, 1:30 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
Index: modules/nodejs/manifests/package.pp
===================================================================
new file mode 100644
--- /dev/null
+++ b/modules/nodejs/manifests/package.pp
@@ -0,0 +1,26 @@
+# == Type: nodejs::package
+#
+# Manage nodejs packages.
+#
+# === Parameters:
+#
+# [*options*]
+# A list of zero or more options to install the package.
+#
+define nodejs::package (
mathias 2017/07/09 07:26:50 Shouldn't there be some $ensure parameter in order
+ $options = [],
+) {
+
+ $install_command = [
+ "npm", "install",
+ $options,
+ $title,
+ ]
+
+ exec {"install_$title":
+ path => ["/usr/bin"],
+ command => shellquote($install_command),
+ require => Package['nodejs'],
+ onlyif => "test ! -x /usr/bin/${title}",
mathias 2017/07/09 07:26:50 Please use the 'creates' parameter instead.
+ }
+}

Powered by Google App Engine
This is Rietveld