An open API service indexing awesome lists of open source software.

https://github.com/dgibbs64/ansible-role-nodejs

An Ansible role that installs Node.js.
https://github.com/dgibbs64/ansible-role-nodejs

Last synced: 2 months ago
JSON representation

An Ansible role that installs Node.js.

Awesome Lists containing this project

README

        

# nodejs

An [Ansible](https://www.ansible.com) role that installs [Node.js](https://nodejs.org) use the [nodesource](https://github.com/nodesource/distributions) repositories.







Codacy grade
GitHub Workflow Status
GitHub tag (latest by date)
MIT License

## About

[Node.js](https://nodejs.org) 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](https://github.com/nodesource/distributions) 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._

## Requirements

### Supported Distros

- 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

### Supported Architectures

- x86_64
- aarch64
- armv7l

_Note: if there are any more Debian or RedHat Based distros that are supported please let me know._

## Role Variables

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.

```yaml
# nodejs version (lts|current|distro)
nodejs_version: lts
# nodejs state (absent|present)
nodejs_state: present
```

## Dependencies

```yaml
community.general
```

## Example Playbook

```yaml
---
- name: Node.js
hosts: all
roles:
- dgibbs64.nodejs
```

## License

MIT

## Author Information

- [Daniel Gibbs](https://danielgibbs.co.uk)