ansible-role.nodejs
Node.js Ansible Role
This is an Ansible role that installs Node.js using Node Version Manager (NVM) on Ubuntu or Debian.
Role Variables
Here are the default settings:
role_nodejs_nvm_version: v0.29.0
role_nodejs_nvm_user: "{{ ansible_ssh_user }}"
role_nodejs_nvm_destination: "/home/{{ role_nodejs_nvm_user }}/.nvm"
role_nodejs_version: 4.2.1
Example Playbook
Using Default Settings:
- hosts: all
roles:
- ansible-role.nodejs
To Install a Different Node.js Version:
- hosts: all
roles:
- role: ansible-role.nodejs
role_nodejs_version: 0.12.7
Installing Gulp Using Executable Path:
- hosts: all
roles:
- ansible-role.nodejs
tasks:
- name: Install Gulp
npm:
name=gulp
global=yes
executable="{{ ROLE_NODEJS_EXECUTABLE_PATH }}/npm"
become:
yes
become_user:
"{{ ansible_ssh_user }}"
Installing Gulp Using Environment Path:
- hosts: all
roles:
- ansible-role.nodejs
tasks:
- name: Install Gulp
npm:
name=gulp
global=yes
become:
yes
become_user:
"{{ ansible_ssh_user }}"
environment:
PATH: "{{ ROLE_NODEJS_ENVIRONMENT_PATH }}"
License
MIT
Informazioni sul progetto
An Ansible Role for installing Node.js
Installa
ansible-galaxy install ansible-role.nodejs
Licenza
Unknown
Download
391
Proprietario