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

Side by Side Diff: modules/nodejs/manifests/package.pp

Issue 29483578: #2007 - Introduce nodejs module (Closed)
Patch Set: For comment 2 Created July 10, 2017, 8:15 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 # == Type: nodejs::package
2 #
3 # Manage nodejs packages.
4 #
5 # === Parameters:
6 #
7 # [*ensure*]
8 # Translated directly into the state of installed/uninstalled
9 # package.
10 #
11 # [*options*]
12 # A list of zero or more options to install the package.
13 #
14 define nodejs::package (
15 $ensure = 'present',
16 $options = [],
17 ) {
18
19 if ensure_state($ensure) {
20 $command = [
21 "npm",
22 "install",
23 $options,
24 $title,
25 ]
26
27 $creates = "/usr/bin/${title}"
mathias 2017/07/10 22:33:40 Are you sure every package will create a file or e
28 }
29 else {
30 $command = [
31 "npm",
32 "uninstall",
33 $options,
34 $title,
35 ]
36
37 $creates = undef
38 }
39
40 exec {"state_$title":
41 path => ["/usr/bin"],
42 command => shellquote($command),
43 require => Package['nodejs'],
44 creates => $creates,
45 }
46 }
47
OLDNEW

Powered by Google App Engine
This is Rietveld