Git Product home page Git Product logo

ansible-nvm-nodejs's Introduction

williamyeh.nvm-nodejs for Ansible Galaxy

[Deprecated!!] Use williamyeh.nodejs instead.

Summary

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.

Role Variables

Mandatory variables

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.

Optional variables

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"

Usage

Step 1: add role

Add role name williamyeh.nvm-nodejs to your playbook file.

Step 2: add variables

Set vars in your playbook file.

Simple example:

---
# file: simple-playbook.yml

- hosts: all

  roles:
    - williamyeh.nvm-nodejs

  vars:
    nodejs_version: "v0.10.35"

Dependencies

None.

License

Licensed under the Apache License V2.0. See the LICENSE file for details.

History

Rewritten from my pre-Galaxy version: server-config-template.

During refactoring, some roles on Ansible Galaxy also inspired me:

ansible-nvm-nodejs's People

Contributors

william-yeh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ansible-nvm-nodejs's Issues

Error in task apply nvm.sh and set default version

Hi, i use this role with vagrant and ansible 1.7.2 on ubuntu trusty to one month and not have any problem, today i get this error:

TASK: [node | apply nvm.sh and set default version] ***************************
fatal: [dev] => Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/ansible/runner/init.py", line 561, in _executor
exec_rc = self._executor_internal(host, new_stdin)
File "/usr/lib/python2.7/dist-packages/ansible/runner/init.py", line 666, in _executor_internal
return self._executor_internal_inner(host, self.module_name, self.module_args, inject, port, complex_args=complex_args)
File "/usr/lib/python2.7/dist-packages/ansible/runner/init.py", line 756, in _executor_internal_inner
if not utils.check_conditional(cond, self.basedir, inject, fail_on_undefined=self.error_on_undefined_vars):
File "/usr/lib/python2.7/dist-packages/ansible/utils/init.py", line 258, in check_conditional
conditional = template.template(basedir, presented, inject)
File "/usr/lib/python2.7/dist-packages/ansible/utils/template.py", line 115, in template
varname = template_from_string(basedir, varname, vars, fail_on_undefined)
File "/usr/lib/python2.7/dist-packages/ansible/utils/template.py", line 357, in template_from_string
res = jinja2.utils.concat(rf)
File "", line 9, in root
File "/usr/lib/python2.7/json/init.py", line 338, in loads
return _default_decoder.decode(s)
File "/usr/lib/python2.7/json/decoder.py", line 366, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python2.7/json/decoder.py", line 382, in raw_decode
obj, end = self.scan_once(s, idx)
ValueError: Invalid control character at: line 3 column 17 (char 45)

FATAL: all hosts have already failed -- aborting

Any idea?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.