Search code examples
macospuppetboxen

Uninstall nodenv from boxen


Boxen installs nodenv in /opt/boxen/nodenv. Is it ok to uninstall it simply removing the nodenv directory?

rm -rf /opt/boxen/nodenv

I wish to do a clean install, re-running boxen. I could nuke the all boxen installation, but I'm wondering if this can be done in a less dramatic way.


Solution

  • Looking over the repo, it looks like there's no way to perform the standard ensure => absent to remove the nodenv setup using Boxen. I've opened an issue for that, because it should be a way to ensure absent.

    For now, you could:

    • Remove the code referencing nodenv

    Probably looks like this in your manifest/site.pp:

      # node versions
      nodejs::version { 'v0.6': }
      nodejs::version { 'v0.8': }
      nodejs::version { 'v0.10': }
    
    • Add some code like this:

      file {"${boxen::config::home}/nodenv":
        ensure => absent,
      }
      

    Which will make sure that the nodenv directory is absent. It's basically doing the same thing as rm -rf /opt/boxen/nodenv that you mention, but in a more idempotent and Puppet-y way.