{"id":15878935,"url":"https://github.com/darkwizard242/ansible-role-nodejs","last_synced_at":"2026-01-21T14:02:10.230Z","repository":{"id":44306285,"uuid":"277011303","full_name":"darkwizard242/ansible-role-nodejs","owner":"darkwizard242","description":" Ansible role for NodeJS. Available on Ansible Galaxy. ","archived":false,"fork":false,"pushed_at":"2024-05-08T20:45:37.000Z","size":58,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-07T12:35:40.790Z","etag":null,"topics":["ansible","ansible-galaxy","ansible-role","linux","nodejs","npm","npx","system"],"latest_commit_sha":null,"homepage":"https://galaxy.ansible.com/darkwizard242/nodejs","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/darkwizard242.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-04T00:37:41.000Z","updated_at":"2022-06-18T02:45:23.000Z","dependencies_parsed_at":"2024-10-27T10:03:51.889Z","dependency_job_id":"a6481d42-d5e5-43bb-ace8-42c0d22483f6","html_url":"https://github.com/darkwizard242/ansible-role-nodejs","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/darkwizard242/ansible-role-nodejs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darkwizard242%2Fansible-role-nodejs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darkwizard242%2Fansible-role-nodejs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darkwizard242%2Fansible-role-nodejs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darkwizard242%2Fansible-role-nodejs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/darkwizard242","download_url":"https://codeload.github.com/darkwizard242/ansible-role-nodejs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darkwizard242%2Fansible-role-nodejs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28634786,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T04:47:28.174Z","status":"ssl_error","status_checked_at":"2026-01-21T04:47:22.943Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","ansible-galaxy","ansible-role","linux","nodejs","npm","npx","system"],"created_at":"2024-10-06T02:42:24.847Z","updated_at":"2026-01-21T14:02:10.204Z","avatar_url":"https://github.com/darkwizard242.png","language":"Python","readme":"[![build-test](https://github.com/darkwizard242/ansible-role-nodejs/workflows/build-and-test/badge.svg?branch=master)](https://github.com/darkwizard242/ansible-role-nodejs/actions?query=workflow%3Abuild-and-test) [![release](https://github.com/darkwizard242/ansible-role-nodejs/workflows/release/badge.svg)](https://github.com/darkwizard242/ansible-role-nodejs/actions?query=workflow%3Arelease) ![Ansible Role](https://img.shields.io/ansible/role/49595?color=dark%20green%20) ![Ansible Role](https://img.shields.io/ansible/role/d/49595?label=role%20downloads) ![Ansible Quality Score](https://img.shields.io/ansible/quality/49595?label=ansible%20quality%20score) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=ansible-role-nodejs\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=ansible-role-nodejs) [![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=ansible-role-nodejs\u0026metric=sqale_rating)](https://sonarcloud.io/dashboard?id=ansible-role-nodejs) [![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=ansible-role-nodejs\u0026metric=reliability_rating)](https://sonarcloud.io/dashboard?id=ansible-role-nodejs) [![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=ansible-role-nodejs\u0026metric=security_rating)](https://sonarcloud.io/dashboard?id=ansible-role-nodejs) ![GitHub tag (latest SemVer)](https://img.shields.io/github/tag/darkwizard242/ansible-role-nodejs?label=release) ![GitHub repo size](https://img.shields.io/github/repo-size/darkwizard242/ansible-role-nodejs?color=orange\u0026style=flat-square)\n\n# Ansible Role: nodejs\n\nRole to install (_by default_) [nodejs](https://github.com/nodejs/node) package or uninstall (_if passed as var_) on Debian based systems and EL based systems. **nodejs** is a JavaScript runtime environment. **npm** \u0026 **npx** are also installed as part of this role. The default version is set to install version `18.x` of NodeJS unless explicitly specified to install any other specific version as the repository's source is based on that.\n\n## Requirements\n\nNone.\n\n## Role Variables\n\nAvailable variables are listed below (located in `defaults/main.yml`):\n\n### Variables List:\n\n```yaml\nnodejs_app: nodejs\nnodejs_app_desired_state: present\nnodejs_version: 18.x\n\n# Debian family based\nnodejs_debian_pre_reqs:\n  - apt-transport-https\n  - gnupg\nnodejs_debian_pre_reqs_desired_state: present\nnodejs_repo_debian_gpg_key: https://deb.nodesource.com/gpgkey/nodesource.gpg.key\nnodejs_repo_debian: \"deb https://deb.nodesource.com/node_{{ nodejs_version }} {{ ansible_lsb['codename'] }} main\"\nnodejs_repo_debian_filename: \"{{ nodejs_app }}\"\nnodejs_repo_debian_desired_state: present\n\n# EL family based\nnodejs_repo_el: \"https://rpm.nodesource.com/pub_{{ nodejs_version }}/el/{{ ansible_distribution_major_version }}/$basearch\"\nnodejs_repo_el_name: nodesource\nnodejs_repo_el_description: Node.js EL Family Repo\nnodejs_repo_el_gpgkey: https://rpm.nodesource.com/pub/el/NODESOURCE-GPG-SIGNING-KEY-EL\nnodejs_repo_el_gpgcheck: yes\nnodejs_repo_el_enabled: yes\nnodejs_repo_el_filename: \"{{ nodejs_app }}\"\nnodejs_repo_el_desired_state: present\n```\n\n### Variables table:\n\nVariable                             | Description\n------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\nnodejs_app                           | Name of nodejs application package require to be installed i.e. `nodejs`\nnodejs_app_desired_state             | State of the nodejs_app package. Whether to install, verify if available or to uninstall (i.e. ansible apt module values: `present`, `latest`, or `absent`)\nnodejs_version                       | Version of NodeJS to install.\nnodejs_debian_pre_reqs               | NodeJS recommends the installation of both these packages on Debian family systems and as such, they are considered pre-requisites.\nnodejs_debian_pre_reqs_desired_state | Desired state for NodeJS pre-requisite apps on Debian family systems.\nnodejs_repo_debian_gpg_key           | NodeJS GPG key required on Debian family systems\nnodejs_repo_debian                   | NodeJS repo URL for Debain family systems. Utilized facts such as `ansible_lsb['codename']`.\nnodejs_repo_debain_filename          | Name of the repository file that will be stored at `/etc/apt/sources.list.d/` on Debian based systems.\nnodejs_repo_debian_desired_state     | `present` indicates creating the repository file if it doesn't exist on Debian based systems. Alternative is `absent` (not recommended as it will prevent from installation of **nodejs** package).\nnodejs_repo_el                       | Repository `baseurl` for NodeJS on EL based systems. Utilizes `ansible_distribution_major_version` ansible fact to set appropriate version of EL system.\nnodejs_repo_el_name                  | Repository name for NodeJS on EL based systems.\nnodejs_repo_el_description           | Description to be added in EL based repository file for NodeJS.\nnodejs_repo_el_gpgkey                | NodeJS GPG key required on EL family systems\nnodejs_repo_el_gpgcheck              | Boolean for whether to perform gpg check against NodeJS on EL based systems.\nnodejs_repo_el_enabled               | Boolean to set so that NodeJS repository is enabled on EL based systems.\nnodejs_repo_el_filename              | Name of the repository file that will be stored at `/yum/sources.list.d/nodejs.repo` on EL based systems.\nnodejs_repo_el_desired_state         | `present` indicates creating the repository file if it doesn't exist on EL based systems. Alternative is `absent` (not recommended as it will prevent from installation of **nodejs** package).\n\n## Dependencies\n\nNone\n\n## Example Playbook\n\nFor default behaviour of role (i.e. installation of **nodejs** package) in ansible playbooks.\n\n```yaml\n- hosts: servers\n  roles:\n    - darkwizard242.nodejs\n```\n\nFor customizing behavior of role (i.e. installing 12.x version of nodejs as an example) in ansible playbooks.\n\n```yaml\n- hosts: servers\n  roles:\n    - darkwizard242.nodejs\n  vars:\n    nodejs_version: 14.x\n```\n\nFor customizing behavior of role (i.e. un-installation of **nodejs** package) in ansible playbooks.\n\n```yaml\n- hosts: servers\n  roles:\n    - darkwizard242.nodejs\n  vars:\n    nodejs_apps_desired_state: absent\n```\n\n## License\n\n[MIT](https://github.com/darkwizard242/ansible-role-nodejs/blob/master/LICENSE)\n\n## Author Information\n\nThis role was created by [Ali Muhammad](https://www.alimuhammad.dev/).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarkwizard242%2Fansible-role-nodejs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdarkwizard242%2Fansible-role-nodejs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarkwizard242%2Fansible-role-nodejs/lists"}