Coder Social home page Coder Social logo

stephdewit / ansible-nvm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from leonidas/ansible-nvm

15.0 15.0 17.0 69 KB

Ansible role to install Node.js

Home Page: https://galaxy.ansible.com/stephdewit/nvm

ansible ansible-galaxy ansible-role nodejs npm nvm

ansible-nvm's People

Contributors

danmichaelo avatar hypery2k avatar jdrouet avatar rikukissa avatar stephdewit avatar ukch avatar weslyg avatar wtower avatar xiaoyao9184 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ansible-nvm's Issues

~/.profile not found

grafik

simply touching that file before running the ansible-role helped.
so perhaps you should ensure the existence of that file before.

sudo

Hi @stephdewit this query is sort of related to #4

Would it be possible to update the role so that the setup-.yml can be bypassed? This is the only place that the role contains the becomes stanza.

I'm using the role with users that don't have sudo access.

Prior to their use on the host, I can provide the dependencies that are required by this role.

Ideally having a variable nvm_install_deps or nvm_bypass_setup etc. would be great.

- include: setup-redhat.yml
  when: ansible_os_family == "RedHat" and nvm_install_deps == true
  tags: nvm

Thanks for your time.
Damian.

Install as non-root user

Installing in a vagrant environment. Playbook as follows:

   - role: stephdewit.nvm
      become: yes
      become_user: vagrant
      nvm_shell_init_file: ~/.bashrc

Error log:

TASK [nvm : Install Node.js 12.13.0] *****************************************************************
fatal: [192.168.33.22]: FAILED! => {"changed": true, "cmd": ". ~/.bashrc && nvm install 12.13.0", "delta": "0:00:00.001649", "end": "2019-12-30 18:32:02.526579", "msg": "non-zero return code", "rc": 127, "start": "2019-12-30 18:32:02.524930", "stderr": "/bin/sh: 1: nvm: not found", "stderr_lines": ["/bin/sh: 1: nvm: not found"], "stdout": "", "stdout_lines": []}

nvm is installed for the vagrant user, but installing node fails. Installing node as vagrant user via the command line works as expected.

$ nvm install 12.13.0
Downloading and installing node v12.13.0...
Local cache found: ${NVM_DIR}/.cache/bin/node-v12.13.0-linux-x64/node-v12.13.0-linux-x64.tar.xz
Checksums match! Using existing downloaded archive ${NVM_DIR}/.cache/bin/node-v12.13.0-linux-x64/node-v12.13.0-linux-x64.tar.xz
Now using node v12.13.0 (npm v6.12.0)

Have to set NVM_DIR

I have to add:

  environment:
    NVM_DIR: '{{ nvm_install_path }}'

to the last three tasks to make them work. Otherwise NVM_DIR is set to /bin and the tasks fail due to permission errors.

Ubuntu 18.04
Ansible 2.8.0

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.