8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'manifests/local.pp', line 8
define nodejs::local($version = undef, $ensure = present) {
include nodejs
case $version {
'system': { $_node_local_require = undef }
undef: { $_node_local_require = undef }
default: {
ensure_resource('nodejs::version', $version)
$_node_local_require = Nodejs::Version[$version]
}
}
file {
"${name}/.node-version":
ensure => $ensure,
content => "${version}\n",
replace => true,
require => $_node_local_require ;
"${name}/.nodenv-version":
ensure => absent,
before => File["${name}/.node-version"],
require => $_node_local_require ;
}
}
|