lean_delivery.nodejs
nodejs role
Summary
This role:
- installs Node.js on EL and Ubuntu.
- make preparation and install Node.js packages globally.
Requirements
- Version of the ansible for installation: 2.5
- Supported OS
- EL
- 6
- 7
- Ubuntu
- 16.04
- 18.04
- EL
Role Variables
required
nodejs_branch- is used to select main nodejs branch to be installed.
default value is8.nodejs_version- version of node.js.
default value is8*
defaults
nodejs_apt_key- GPG-key for APT repositories
default value ishttps://deb.nodesource.com/gpgkey/nodesource.gpg.keynodejs_apt_url- path to nodejs APT repository
default value isdeb https://deb.nodesource.com/node_{{ nodejs_branch }}.x {{ ansible_distribution_release }} mainnodejs_transport- RedHat distribution transport
default value is{{ ansible_distribution_major_version is version('7', '<') | ternary('http','https') }}nodejs_rpm_key- GPG-key for RPM repositories
default value is{{ nodejs_transport }}://rpm.nodesource.com/pub/el/NODESOURCE-GPG-SIGNING-KEY-ELnodejs_yum_url- path to nodejs RPM repositorybuild_tools- to compile and install native addons from npm you may also need build tools.
default value isFalse.npm_global_user- global packages owner.
default value is""(global packages are not installed).npm_global_group- global packages group.
default value is""(global packages are not installed).npm_global_directory- global installation directory.
default value is/usr/local/lib/npm.npm_global_packages- a list of npm packages with a name and a version.
default value is[].
Dependencies
None.
Example Playbook
- name: "Install node.js on remote hosts"
hosts: servers
vars:
nodejs_branch: 10
nodejs_version: 10.15.3
build_tools: True
npm_global_user: user
npm_global_group: user
npm_global_directory: /home/user/.local
npm_global_packages:
- lodash
- name: express
version: 4.16.0
roles:
- role: ansible-role-nodejs
Inventory example
[servers]
127.0.0.1
Install nodejs role
$ ansible-playbook playbook.yml -i inventory
License
Apache
Author Information
authors:
- Lean Delivery Team team@lean-delivery.com
Install
ansible-galaxy install lean_delivery.nodejsLicense
apache-2.0
Downloads
1.8k
Owner
Simplify by using!
