logicalparadox/puppet-nodejs — pull request #3 by sirn (2013-03-19 21:44:56+00:00)
Title: Detect nodejs installation in /usr/local

This patch updates PATH to include /usr/local/bin so `which` could find the node binary. I also need to update the init.pp to include `unless` in all `exec` to prevent the script from being run when it detects that node is already installed (but nothing in /tmp).

From my testing (using Vagrant running Ubuntu 64-bit and Puppet 3.0) I've found that `unless` did not prevent `require` from being satisfied. The original init.pp redownloads and recompile node from source every time `puppet apply` is run if `/tmp/node-${node_ver}` is removed (such as removed as part of reboot), even with node already installed.

I added the `unless` to all `exec` and everything seems to works as expected now. I'm pretty new to Puppet so I'm not sure if this is the best way to fix it.