All of the functionality provided by this role and more is available in the DebOps project. If you are using some of my roles in conjunction with each other, you will find the move to DebOps most pleasurable.
This role will be removed from the galaxy and from github anywhere from 42 microseconds to 2-3 weeks after you read this message.
It is an ansible role to install the latest stable version of nodejs without having to compile nodejs on the machine you're setting up.
Compiling node on a low end VPS/instance could easily take 10 minutes and during that time your CPU is going to be pegged at 100%.
ansible-node solves this by using a rock solid third party apt repository where the author maintains the latest stable version of nodejs for many ubuntu builds. You can also supply your own ppa if you want a different one.
---
# The ppa to pull in nodejs.
nodejs_ppa: "ppa:chris-lea/node.js"
# The amount in seconds to cache apt-update.
apt_cache_valid_time: 86400
For the sake of this example let's assume you have a group called app and you have a typical site.yml
file.
To use this role edit your site.yml
file to look something like this:
---
- name: ensure app servers are configured
- hosts: app
roles:
- { role: nickjj.nodejs, tags: node }
Let's say you want to edit the ppa repo, you can do this by opening or creating group_vars/app.yml
which is located relative to your inventory
directory and then making it look something like this:
---
nodejs_ppa: "ppa:somewhere/nodejs.js"
$ ansible-galaxy install nickjj.nodejs
Tested on ubuntu 12.04 LTS but it should work on other versions that are similar.
You can find it on the official ansible galaxy if you want to rate it.
MIT