Skip to content

Instantly share code, notes, and snippets.

@nerdfiles
Forked from badsyntax/nodejs.pp
Created April 15, 2016 03:52
Show Gist options
  • Save nerdfiles/7913d630c5eab8cccb0bead515ee77ee to your computer and use it in GitHub Desktop.
Save nerdfiles/7913d630c5eab8cccb0bead515ee77ee to your computer and use it in GitHub Desktop.
Puppet: Installing node.js via nvm
class nodejs {
exec { 'nvm-install':
command => '/usr/bin/curl https://raw.github.com/creationix/nvm/master/install.sh | /bin/sh',
creates => '/home/vagrant/.nvm',
user => 'vagrant',
environment => 'HOME=/home/vagrant',
require => Package['curl']
}
exec { 'node-install':
command => '/bin/bash -c "source /home/vagrant/.nvm/nvm.sh && nvm install 0.10.23 && nvm alias default 0.10.23"',
user => 'vagrant',
environment => 'HOME=/home/vagrant',
require => Exec['nvm-install']
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment