stephdewit / ansible-nvm Goto Github PK
View Code? Open in Web Editor NEWThis project forked from leonidas/ansible-nvm
Ansible role to install Node.js
Home Page: https://galaxy.ansible.com/stephdewit/nvm
This project forked from leonidas/ansible-nvm
Ansible role to install Node.js
Home Page: https://galaxy.ansible.com/stephdewit/nvm
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.
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)
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.