Comments (3)
How I solved this problem:
roles:
- role: nodesource.node
become: yes
from ansible-nodejs-role.
With some additional trial/error, I realized by looking in the role.yml
file used for testing that it calls the role and specifies sudo: yes
when calling the role instead of having each task within the role define sudo: yes
.
I updated my meta/main.yml
file to look like this:
dependencies:
- {
role: "nodesource.node",
sudo: yes
}
and the script worked as expected without error.
I would just close this issue as solved, but it begs the question in my mind: when will we ever not call this role with sudo: yes
? If it is required, then would it be easier to just update the tasks/main.yml
to put that on each task and then folks do not need to worry about setting it when calling the role?
Thoughts appreciated.
from ansible-nodejs-role.
@conorgil I also highly recommend to use this in addition to your recommendation:
sudo_user: "{{ ansible_ssh_user}}"
.
Running purely as sudo will run commands as root and leave applications unavailable to the default user.
Just because the script passes, it doesn't mean the user is able to access all of these cool tools (without sudo - best practice!).
I would also recommend changing sudo
to become
and sudo_user
to become_user
purely because the sudo
and sudo_user
modules have been deprecated in later releases.
from ansible-nodejs-role.
Related Issues (20)
- Have to use sudo with npm -g
- Yum instead of apt HOT 1
- Should support nodejs 4.x versions HOT 2
- Add support for RedHat platforms HOT 5
- Role Broken, possible external package removed HOT 19
- Use github tags/releases for versioning
- This role is unusable with 5.x HOT 6
- Can't install the specific version of nodejs HOT 1
- SSL Failure on Import the NodeSource GPG key into apt HOT 17
- Install Node.js fails, "Could not fetch updated apt files" HOT 6
- Previous installed Node doesn't get upgraded
- The new LTS is now 6.x HOT 1
- Outdated supported OS list on Ansible Galaxy
- bionic (ubuntu 18.04), gpg required HOT 1
- Question: Is this role still maintained / recommended? HOT 2
- Support for 20.04 is missing
- Register variable for task completion
- io.js Ansible role HOT 3
- Importing NodeSource GPG key fails with ansible 1.9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ansible-nodejs-role.