Ansible role for setting up nodejs.
Go to file
Dorian d83fb1362a Modify to not use raw variables that are deprecated. 2016-10-02 15:46:46 -04:00
defaults Minor stylistic fixes. 2016-05-19 07:52:46 -04:00
handlers Initiial creation of the Ansible NodeJS role. 2016-03-15 08:32:38 -04:00
meta Add additional documentation for setting up the NodeJS role. 2016-03-15 18:09:29 -04:00
tasks Modify to not use raw variables that are deprecated. 2016-10-02 15:46:46 -04:00
templates Get working setup for local development setup. 2016-03-15 10:10:17 -04:00
tests Initiial creation of the Ansible NodeJS role. 2016-03-15 08:32:38 -04:00
vars Get working setup for local development setup. 2016-03-15 10:10:17 -04:00
.gitignore Add a gitignore file for the role. 2016-05-17 18:16:38 -04:00
.travis.yml Initiial creation of the Ansible NodeJS role. 2016-03-15 08:32:38 -04:00
README.md Add additional documentation for setting up the NodeJS role. 2016-03-15 18:09:29 -04:00

README.md

Ansible NodeJS

An Ansible role that helps setup and install modern versions of NodeJS for Ubuntu systems. This role aims to simplify the setup of both production and local development machines.

This role is a component of the NGINX NodeJS role used to deploy NodeJS web applications.

Requirements

This role is Ubuntu specific. Also note that NodeJS 5.x works on Ubuntu 12.04 and greater.

Role Variables

A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.

Example Playbook

Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:

- hosts: servers
  roles:
     - { role: username.rolename, x: 42 }

Local Development Setup

This role can be used to provision and setup a local development environment.

Create a local playbook local_playbook.yml:

---
- hosts: localhost
  user: $MY_USER_NAME
  roles:
    - { role: "ansible-nodejs",
              node_version_family: "4.x",
              local_development: {
                user: "$MY_USER_NAME",
                enabled: true
              },
              globally_installed_tools: [
                "browserify",
                "coffee-script",
                "less",
                "npmrc",
                "grunt-cli",
                "karma-cli"
              ]
             }

Create a inventory for connecting to the localhost: localhost_inventory:

localhost ansible_connection=local ansible_become=true

Run the playbook locally:

ansible-playbook local_playbook.yml -i localhost_inventory -vvvv -K

License

BSD

Author Information

An optional section for the role authors to include contact information, or a website (HTML is not allowed).