Comments (5)
Oops! I'll have to fix that. The best way to get it installed in the mean time is with:
nodejs_npm_global_packages:
- forever
Or with a version:
nodejs_npm_global_packages:
- name: forever
version: 0.15.3
from ansible-for-devops.
Thanks for the quick response! Unfortunately, I tried adding this variable to provision.yml
, and I'm still getting the same error message. When I ssh'd to the vagrant machine with vagrant ssh
, I noticed that forever
was available when I was running as the vagrant
user, but not when I was root
. And if I'm understanding correctly, the ansible playbook runs as root
. But I thought that installing the package globally would have also installed it for root
?
Thanks for your help :)
from ansible-for-devops.
@mattjmcnaughton - I'm taking a look at this now.
from ansible-for-devops.
Yeah, in this case it looks like there's some extra trickery going on to get forever into the path /usr/local/lib/npm/bin/forever
, and when I use sudo
it's not in my path.
Two options are to:
- Doubly ensure that global packages are installed under the
sudo
user (in which case it goes to/usr/bin/forever
and is accessible everywhere) (maybe there's a bug in my role?) - Run the app deployment as the
ansible_ssh_user
instead of usingsudo
/become.
from ansible-for-devops.
@mattjmcnaughton - Aha! It looks like I had to set the following vars:
nodejs_install_npm_user: root
npm_config_prefix: "/usr"
nodejs_npm_global_packages:
- forever
Because that new config prefix is the parent directory inside which Node.js' global installs will be in the bin
. Pushing up a fix soon, and I'll fix it in the book as well.
from ansible-for-devops.
Related Issues (20)
- Deploy a version controlled application HOT 2
- Molecule CI installation requires molecule-plugins[docker] install HOT 1
- Create Drupal project task is failing with below errors HOT 1
- Flask example is failing in CI tests currently HOT 1
- Chapter 3: CHANGED vs SUCCESS
- Chapter 3: check log files - fix grep command HOT 2
- Chapter 3 - Manage cron jobs
- Broken Link : Chapter 5 - Variable Precedence HOT 1
- Suboptimal command - Chapter 2 - Your first Ansible playbook
- molecule lint is gone. HOT 1
- Add a section for Ansible Semaphore?
- Links to Galaxy documentation are broken HOT 1
- hostvars confusion HOT 2
- Pi4 aarch64 FAILED! => "E: Package 'python-apt' has no installation candidate HOT 1
- RPM Repo(Chapter 6): Permission denied HOT 3
- Link to "sample sudoers file" (Chapter 11) returns Error 404
- molecule init role is gone HOT 5
- Include a Section on Using Goss for Testing
- Chapter 15 Ansible and Docker: No module named 'requests'
- on Chapter3, Page 36: unable to connect to database, check login_user and login_password HOT 1
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-for-devops.