Skip to content

Instantly share code, notes, and snippets.

@drudge
Created June 25, 2012 17:17
Show Gist options
  • Save drudge/2989972 to your computer and use it in GitHub Desktop.
Save drudge/2989972 to your computer and use it in GitHub Desktop.
Node.js Puppet Module
class nodejs ( $version, $logoutput = 'on_failure' ) {
$nave_path = '/usr/local/bin/nave'
$nave_dir = '/usr/local/lib/nave'
package { 'bash':
ensure => present,
}
package { 'curl':
ensure => present,
}
package { 'libssl-dev':
ensure => present,
}
package { 'build-essential':
ensure => present,
}
exec { 'install nave':
command => "curl -s 'https://raw.github.com/isaacs/nave/master/nave.sh' -o '${nave_path}'",
path => [ "/usr/local/bin", "/bin" , "/usr/bin" ],
require => Package[ 'curl' ],
creates => "${nave_path}",
logoutput => $logoutput,
}
file { $nave_path:
mode => 755,
require => Exec['install nave'],
}
exec { "compile node ${version} with nave" :
command => "${nave_path} usemain $version",
path => [ "/usr/local/bin", "/bin" , "/usr/bin" ],
require => [ Exec['install nave'], Package[ 'curl' ], Package[ 'libssl-dev' ], Package[ 'build-essential' ] ],
environment => [ "NAVE_DIR=\"$nave_dir\"", 'PREFIX=/usr/local/lib/node', 'NAVE_JOBS=1' ],
logoutput => $logoutput,
timeout => 0,
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment