An Ansible role that installs Node.js use the nodesource repositories.
Node.js is a free, open-source, cross-platform JavaScript runtime environment that lets developers create servers, web apps, command line tools and scripts. This role installs Node.js using the nodesource repositories to install the latest Node.js deb/rpm packages typically allowing for the installation of the newer version of Node.js than is available in the default distro repositories. This role can also remove Node.js and the nodesource repositories.
Note: this role does not use the nvm method to install Node.JS.
- AlmaLinux >= 8
- AmazonLinux 2023
- CentOS >= 8
- Debian >= 10
- Fedora >= 29
- OracleLinux >= 8
- Pop!_OS >= 20.04
- Redhat Enterprise Linux >= 8
- Rocky Linux >= 8
- Ubuntu >= 20.04
- x86_64
- aarch64
- armv7l
Note: if there are any more Debian or RedHat Based distros that are supported please let me know.
By default this role will setup Node.js LTS version. You can change the version to current or distro by setting the nodejs_version
variable.
- LTS: Long Term Suport version.
- Current: Latest version.
- Distro: Version provided by the distribution.
# nodejs version (lts|current|distro)
nodejs_version: lts
# nodejs state (absent|present)
nodejs_state: present
community.general
---
- name: Node.js
hosts: all
roles:
- dgibbs64.nodejs
MIT