Skip to content

nickjj/ansible-nodejs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WARNING: This role will be deprecated very soon

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.


What is ansible-nodejs? Build Status

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.

What problem does it solve and why is it useful?

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.

Role variables

---
# 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

Example playbook

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"

Installation

$ ansible-galaxy install nickjj.nodejs

Requirements

Tested on ubuntu 12.04 LTS but it should work on other versions that are similar.

Ansible galaxy

You can find it on the official ansible galaxy if you want to rate it.

License

MIT

About

Install the latest stable version of nodejs with ansible.

Resources

Stars

Watchers

Forks

Packages

No packages published