Puppet Class: nodejs::nodenv

Defined in:
manifests/nodenv.pp

Overview

Parameters:

  • ensure (Any) (defaults to: $nodejs::nodenv::ensure)
  • prefix (Any) (defaults to: $nodejs::nodenv::prefix)
  • user (Any) (defaults to: $nodejs::nodenv::user)
  • plugins (Any) (defaults to: {})


10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'manifests/nodenv.pp', line 10

class nodejs::nodenv(
  $ensure  = $nodejs::nodenv::ensure,
  $prefix  = $nodejs::nodenv::prefix,
  $user    = $nodejs::nodenv::user,
  $plugins = {}
) {

  require nodejs

  repository { $prefix:
    ensure => $ensure,
    force  => true,
    source => 'OiNutter/nodenv',
    user   => $user
  }

  file { "${prefix}/versions":
    ensure  => symlink,
    force   => true,
    backup  => false,
    target  => '/opt/nodes',
    require => Repository[$prefix]
  }

  if !empty($plugins) and $ensure != 'absent'  {
    create_resources('nodejs::nodenv::plugin', $plugins)
  }

}