Installing Nodered using Ansible
30 Sep 2014Recently I’ve been playing around with Vagrant and Ansible to configure my home server. The server runs a few local network services and I’m working on some home automation stuff which I hope to base on NodeRed, in this post I’ll describe how I’ve used Ansible to install NodeRed with git.
Installation
Dependencies
Since Nodered is a NodeJS application, we need to install a few dependencies first, I’m using apt and npm to do this but the method can be easily modified to the appropriate package manager:
NodeRed
There are a few ways to install Nodered; from a downloaded archive, using git or plain npm, I’ve chosen git as it allows me to easily upgrade just by changing the version tag and rerunning Ansible. All the functionality to get the code is built into Ansible:
Running
Launching node applications from the command line is tricky as if they crash the application doesn’t have a mechanism to recover, I’ve chosen to use forever to solve this issue, however it won’t make the application start on boot so further configuration would be required to enable that.
Forever has already been installed using npm (above) so after installation we can dive straight into running it: