-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathinit.pp
More file actions
46 lines (40 loc) · 1.3 KB
/
init.pp
File metadata and controls
46 lines (40 loc) · 1.3 KB
1
2
3
4
5
6
7
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
class nodejs ( $version, $logoutput = 'on_failure' ) {
if ! defined(Package['curl']) {
package { 'curl':
ensure => present,
}
}
case $operatingsystem {
centos, redhat: {
$libssl_dev_pkgname = 'openssl-devel'
exec { 'yum Group Install':
unless => '/usr/bin/yum grouplist "Development tools" | /bin/grep "^Installed Groups"',
command => '/usr/bin/yum -y groupinstall "Development tools"',
before => Exec['nave']
}
}
debian, ubuntu: {
$libssl_dev_pkgname = 'libssl-dev'
package { 'build-essential':
ensure => present,
before => Exec['nave']
}
}
default: { fail("Unrecognized operating system for webserver") }
}
package { 'libssl-dev':
name => $libssl_dev_pkgname,
ensure => present,
}
# use nave, yo
exec { 'nave' :
command => "bash -c \"\$(curl -s 'https://raw.github.com/isaacs/nave/master/nave.sh') usemain $version \"",
path => [ "/usr/local/bin", "/bin" , "/usr/bin" ],
require => [ Package[ 'curl' ], Package[ 'libssl-dev' ] ],
environment => [ 'HOME=""', 'PREFIX=/usr/local/lib/node', 'NAVE_JOBS=1' ],
logoutput => $logoutput,
# btw, this takes forever....
timeout => 0,
unless => "test \"v$version\" = \"\$(node -v)\""
}
}