[Deprecated!!] Use williamyeh.nodejs instead.
Role name in Ansible Galaxy: williamyeh.nvm-nodejs
This Ansible role has the following features for NVM & Node.js:
- Install specific version of NVM.
- Install specific version of Node.js (including io.js) via NVM.
This role will install NVM globally. If you prefer NVM being installed on a per-user basis (i.e., on $HOME/.nvm
directory of each user), try alternatives such as g-div/ansible-nvm.
Variables needed to be defined in user's playbook:
nodejs_version
For example:
nodejs_version: "v0.10.35"
Use nvm ls-remote
command to get a list of valid version strings.
User-configurable defaults:
# parent path of NVM to be installed on
nvm_parent_path: /opt
# path of NVM to be installed on;
# never override it unless absolutely necessary!
nvm_install_path: "{{ nvm_parent_path }}/nvm"
Add role name williamyeh.nvm-nodejs
to your playbook file.
Set vars in your playbook file.
Simple example:
---
# file: simple-playbook.yml
- hosts: all
roles:
- williamyeh.nvm-nodejs
vars:
nodejs_version: "v0.10.35"
None.
Licensed under the Apache License V2.0. See the LICENSE file for details.
Rewritten from my pre-Galaxy version: server-config-template.
During refactoring, some roles on Ansible Galaxy also inspired me:
- leonidas.nvm forks, especially ahmednuaman.nvm-ahmed and then g-div/ansible-nvm