https://github.com/claranet/ansible-role-nodejs
Install and configure NodeJS
https://github.com/claranet/ansible-role-nodejs
ansible claranet nodejs role
Last synced: about 2 months ago
JSON representation
Install and configure NodeJS
- Host: GitHub
- URL: https://github.com/claranet/ansible-role-nodejs
- Owner: claranet
- License: mpl-2.0
- Created: 2022-09-29T15:08:20.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-20T08:48:29.000Z (12 months ago)
- Last Synced: 2025-03-28T00:34:31.367Z (2 months ago)
- Topics: ansible, claranet, nodejs, role
- Language: Jinja
- Homepage:
- Size: 46.9 KB
- Stars: 2
- Watchers: 12
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Ansible role - nodejs
[](https://www.claranet.fr/)
[](LICENSE)
[](https://github.com/claranet/ansible-role-nodejs/releases)
[](https://github.com/claranet/ansible-role-nodejs/actions?query=workflow%3A%22Ansible+Molecule%22)
[](https://github.com/ansible/ansible)
[](https://galaxy.ansible.com/claranet/nodejs)> :star: Star us on GitHub — it motivates us a lot!
Install and configure NodeJS
## :warning: Requirements
Ansible >= 2.10
## :zap: Installation
```bash
ansible-galaxy install claranet.nodejs
```## :gear: Role variables
Variable | Default value | Required | Description
----------------------------------|---------------|----------|---------------------------------------------------------------------
nodejs_version | **undef** | true | version of nodejs to install. It can be short : "16" or long : "16.11"
nodejs_npm | **{}** | false | list of npm packages to install
nodejs_uses_debian_repository | **false** | false | Whether to use the Debian repository or not. It will intall from debian file package by default
nodejs_proxy_settings_https_proxy | **''** | false | proxy to use to get https links. Ex: https://proxy:3128
nodejs_proxy_settings_http_proxy | **''** | false | proxy to use to get http links. Ex: https://proxy:3128If using the short nodejs_version (ex: 16), it will use the NodeSource repository.
If using the short nodejs_version (ex: 16) AND nodejs_uses_debian_repository is true, it will use the Debian Repository.
If using the long nodejs version, it will download the package from NodeSource and install it with dpkg (not all packages are available directly from the repository).
## :arrows_counterclockwise: Dependencies
N/A
## :pencil2: Example Playbook
* Install using deb files
```yaml
---
- name: Install NodeJS With deb files
hosts: all
vars:
nodejs_version: "16.17.1"
nodejs_npm:
coffeescript: {}
chance:
version: "1.1.3"
enzyme:
state: absent
nodejs_proxy_settings_https_proxy: "https://proxy:3128"
nodejs_proxy_settings_http_proxy: "https://proxy:3128"
roles:
- claranet.nodejs
```* Install using apt repository
```yaml
---
- name: Install NodeJS With deb files
hosts: all
vars:
nodejs_version: "16"
nodejs_uses_debian_repository: true
nodejs_npm:
coffeescript: {}
chance:
version: "1.1.3"
enzyme:
state: absent
nodejs_proxy_settings_https_proxy: "https://proxy:3128"
nodejs_proxy_settings_http_proxy: "https://proxy:3128"
roles:
- claranet.nodejs
```## :closed_lock_with_key: [Hardening](HARDENING.md)
## :heart_eyes_cat: [Contributing](CONTRIBUTING.md)
## :copyright: [License](LICENSE)
[Mozilla Public License Version 2.0](https://www.mozilla.org/en-US/MPL/2.0/)