{"id":19624182,"url":"https://github.com/don-rumata/ansible-role-install-nodejs","last_synced_at":"2026-04-11T10:34:08.578Z","repository":{"id":177573061,"uuid":"280830417","full_name":"don-rumata/ansible-role-install-nodejs","owner":"don-rumata","description":"Ansible Role: Install NodeJS 4 Linux and Windows","archived":false,"fork":false,"pushed_at":"2021-05-02T23:03:28.000Z","size":35,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-09T09:04:24.271Z","etag":null,"topics":["ansible","ansible-role","centos","debian","fedora","linux","nodejs","opensuse","snap","snappy","ubuntu","windows"],"latest_commit_sha":null,"homepage":"https://galaxy.ansible.com/don_rumata/ansible_role_install_nodejs","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/don-rumata.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-19T09:11:47.000Z","updated_at":"2021-10-07T13:46:32.000Z","dependencies_parsed_at":"2023-12-09T22:30:43.347Z","dependency_job_id":null,"html_url":"https://github.com/don-rumata/ansible-role-install-nodejs","commit_stats":null,"previous_names":["don-rumata/ansible-role-install-nodejs"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/don-rumata/ansible-role-install-nodejs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/don-rumata%2Fansible-role-install-nodejs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/don-rumata%2Fansible-role-install-nodejs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/don-rumata%2Fansible-role-install-nodejs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/don-rumata%2Fansible-role-install-nodejs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/don-rumata","download_url":"https://codeload.github.com/don-rumata/ansible-role-install-nodejs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/don-rumata%2Fansible-role-install-nodejs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31677816,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-11T08:18:19.405Z","status":"ssl_error","status_checked_at":"2026-04-11T08:17:08.892Z","response_time":54,"last_error":"SSL_read: 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-role","centos","debian","fedora","linux","nodejs","opensuse","snap","snappy","ubuntu","windows"],"created_at":"2024-11-11T11:37:13.471Z","updated_at":"2026-04-11T10:34:08.525Z","avatar_url":"https://github.com/don-rumata.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ansible Role: Install NodeJS\n\n[![License][license-image]][license-url] [![Ansible Galaxy][ansible-galaxy-image]][ansible-galaxy-url] [![CircleCI][circleci-image]][circleci-url]\n\nInstall [nodejs](https://nodejs.org/) for Linux and Windows.\n\n## Work on\n\n### Ansible Galaxy style\n\n```yaml\n  platforms:\n    - name: Fedora\n      versions:\n        - 33\n    - name: Ubuntu\n      versions:\n        - trusty\n        - xenial\n        - bionic\n        - cosmic\n        - disco\n        - eoan\n        - focal\n    - name: Debian\n      version:\n        - jessie\n        - stretch\n        - buster\n        - sid\n    # https://github.com/ansible/galaxy/issues/2072\n    - name: EL\n      versions:\n        - 7\n        - 8\n    - name: opensuse\n      vesrion:\n        - tumbleweed\n        - 15.2\n    - name: Windows\n      version:\n        - 2008x64 (7 64bit)\n        - 2019 (10 64bit)\n```\n\n## Requirements\n\n[min_ansible_version: 2.8](https://docs.ansible.com/ansible/latest/modules/snap_module.html)\n\n## Role Variables\n\n```yaml\n#--- NodeJS method install ---#\nnodejs_method_install: package-manager\n# nodejs_method_install: snap\n\n#--- Version section ---#\nnodejs_major_version: lts\n# nodejs_major_version: current\n# nodejs_major_version: 14\n# nodejs_major_version: 12\n# nodejs_major_version: 10\n\n#--- Proxy section ---#\nnodejs_use_over_proxy: false\n# nodejs_use_over_proxy: true\nnodejs_proxy_host: proxy.example.com\nnodejs_proxy_port: 3128\nnodejs_proxy_string: http://{{ nodejs_proxy_host }}:{{ nodejs_proxy_port }}\n\n#--- Repo section ---#\nnodejs_index_json_url: https://nodejs.org/dist/index.json\nnodejs_repo_deb_key: https://deb.nodesource.com/gpgkey/nodesource.gpg.key\nnodejs_repo_rpm_key: https://rpm.nodesource.com/pub/el/NODESOURCE-GPG-SIGNING-KEY-EL\n\n# If you have a copy on your local network\n# nodejs_direct_url_win: http://10.10.10.10/soft/nodejs/node-latest-amd64.msi\n# nodejs_direct_url_win: \\\\10.10.10.10\\soft\\nodejs\\node-latest-amd64.msi\n\n# If you *NOT* use apt-cacher-ng or other caching proxy - select \"https\".\nhttp_or_https: http\n# http_or_https: https\n```\n\n## Dependencies\n\n### If you want deploy to Windows 7\n\nDownload and install [Windows Management Framework 5.1](https://www.microsoft.com/en-us/download/details.aspx?id=54616)\n\n## HowTo\n\n### How to install role\n\nOver `ansible-galaxy`:\n\n```bash\nansible-galaxy install don_rumata.ansible_role_install_nodejs\n```\n\nOver `bash+git`:\n\n```bash\nmkdir -p \"$HOME/.ansible/roles\"\ncd \"$HOME/.ansible/roles\ngit clone https://github.com/don-rumata/ansible-role-install-nodejs don_rumata.ansible_role_install_nodejs\n```\n\n### Quick config WinRM for Windows\n\n\u003chttps://ru.stackoverflow.com/a/949971/191416\u003e\n\n## Example Playbooks\n\n### I\n\nInstall latest LTS nodejs on Windows or Linux over package manager of you distro:\n\n`install-nodejs.yml`:\n\n```yaml\n- name: Install NodeJS\n  hosts: all\n  strategy: free\n  serial:\n    - \"100%\"\n  roles:\n    - don_rumata.ansible_role_install_nodejs\n  tasks:\n```\n\n### II\n\nInstall version `12`:\n\n`install-nodejs.yml`:\n\n```yaml\n- name: Install NodeJS\n  hosts: all\n  strategy: free\n  serial:\n    - \"100%\"\n  roles:\n    - role: ansible-role-install-nodejs\n      nodejs_major_version: 12\n  tasks:\n```\n\n### III\n\nInstall different versions for different hosts:\n\n`install-nodejs.yml`:\n\n```yaml\n- name: Install NodeJS\n  hosts: all\n  strategy: free\n  serial:\n    - \"100%\"\n  roles:\n    - role: ansible-role-install-nodejs\n  tasks:\n```\n\n`nodejs-inventory.ini`:\n\n```ini\n[linux-hosts]\ndebian-test-01.local\nubuntu-test-01.local nodejs_method_install=snap\ncentos-7-test-01.local ansible_python_interpreter=/usr/bin/python2\ncentos-8-test-01.local\nopensuse-leap-test-01.local nodejs_major_version=12\nopensuse-tumbleweed-test-01.local\nfedora-33-test-01.local nodejs_use_over_proxy=true\n\n[windows-hosts]\n10.10.10.20\n10.10.10.21\n10.10.10.22\n10.10.10.23\nwin7-64 nodejs_direct_url_win=http://10.10.10.10/soft/nodejs/7/node-v12.19.0-x64.msi\nwin10-64 nodejs_direct_url_win=http://10.10.10.10/soft/nodejs/node-latest-amd64-{{ nodejs_major_version }}.msi\n```\n\n```bash\nansible-playbook -i ./nodejs-inventory.ini ./install-nodejs.yml\n```\n\n## License\n\nApache License, Version 2.0\n\n## Author Information\n\n[don Rumata](https://github.com/don-rumata)\n\n## TODO\n\n- Add tests.\n- Add installation support for a specific full version as `12.18.2`.\n\n[license-image]: https://img.shields.io/github/license/don-rumata/ansible-role-install-nodejs.svg\n[license-url]: https://opensource.org/licenses/Apache-2.0\n\n[ansible-galaxy-image]: https://img.shields.io/badge/ansible_galaxy-don__rumata.ansible__role__install__nodejs-blue.svg\n[ansible-galaxy-url]: https://galaxy.ansible.com/don_rumata/ansible_role_install_nodejs\n\n[circleci-image]: https://circleci.com/gh/don-rumata/ansible-role-install-nodejs.svg?style=shield\n[circleci-url]: https://circleci.com/gh/don-rumata/ansible-role-install-nodejs\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdon-rumata%2Fansible-role-install-nodejs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdon-rumata%2Fansible-role-install-nodejs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdon-rumata%2Fansible-role-install-nodejs/lists"}