jebovic.nodejs
NodeJS
Install and Set Up NodeJS
This role is part of my OPS project. Click the link to see it in action. OPS includes many features such as a Vagrant file for development machines, playbooks for orchestrating roles, inventory files, role configuration examples, an Ansible configuration file, and more.
Compatibility
Tested and confirmed to work on:
- Debian jessie (8+)
- Ubuntu Trusty (14.04 LTS)
- Ubuntu Xenial (16.04 LTS)
Role Variables
# NodeJS installation settings
nodejs_apt_key_url: "https://deb.nodesource.com/gpgkey/nodesource.gpg.key"
nodejs_apt_repositories:
- "deb https://deb.nodesource.com/node_{{ nodejs_major_version }} {{ ansible_distribution_release | lower }} main"
- "deb-src https://deb.nodesource.com/node_{{ nodejs_major_version }} {{ ansible_distribution_release | lower }} main"
nodejs_packages:
- nodejs
nodejs_major_version: 6.x # choose between 4.x and 6.x
# NPM basic settings
nodejs_npm_config_path: /usr/local/lib/npm
nodejs_npm_config_unsafe_perm: "false"
nodejs_npm_user: root
nodejs_npm_usergroup: root
nodejs_npm_packages:
- name: npm
version: latest
Example Playbook
- hosts: servers
roles:
- { role: jebovic.nodejs }
Example: Configuration
# Customize NodeJS version and user
nodejs_major_version: 4.x
nodejs_npm_user: me
nodejs_npm_usergroup: me
Tags
- nodejs_config : only update configurations
- nodejs_npm_addons : only install extra npm packages
License
MIT
Author Information
Jérémy Baumgarth GitHub
Installa
ansible-galaxy install jebovic.nodejs
Licenza
mit
Download
763
Proprietario