Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create global install dir #28

Merged
merged 1 commit into from
Jun 6, 2016
Merged

Conversation

thom8
Copy link
Contributor

@thom8 thom8 commented May 29, 2016

This PR will install NPM allowing installation of global packages without root access, which is recommended based on Option 2 -- https://docs.npmjs.com/getting-started/fixing-npm-permissions

Option 1 would require changing permissions of /usr.

Should help resolve geerlingguy/drupal-vm#629 & beetboxvm/beetbox#207

@@ -18,7 +18,11 @@ The Node.js version to install. "0.10" is the default and works on all supported

nodejs_install_npm_user: "{{ ansible_ssh_user }}"

The user for whom the npm packages will be installed can be set here, this defaults to ansible_ssh_user
The user for whom the npm packages will be installed can be set here, this defaults to ansible_user
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ansible 2.0 has deprecated the “ssh” from ansible_ssh_user, ansible_ssh_host, and ansible_ssh_port to become ansible_user, ansible_host -- http://docs.ansible.com/ansible/faq.html

Copy link
Contributor

@oxyc oxyc Jun 2, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Were they added in 2.0, meaning does it bump requirement to 2.0? We need to fix this over at Drupal VM as well.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy to bump to 2.0 at this point; there are few (if any) reasons for people to still be on 1.9.x.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could possibly be changed to drop the dependency on ansible_user as tasks are run as this user by default.
Often the issue is that the task is run in the context of become: yes (sudo) so root user perms are used.

eg.

ansible localhost -c local -m shell -a whoami

ansible localhost -c local -m shell -a whoami --become

@thom8 thom8 changed the title [WIP] Create global install dir Create global install dir May 29, 2016
@thom8
Copy link
Contributor Author

thom8 commented May 29, 2016

Ready for review.

@thom8 thom8 force-pushed the global_dir branch 13 times, most recently from 87d4b18 to dfcd192 Compare May 30, 2016 06:12
- 'sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm npm list -g --depth=0 yo'
- 'sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm NPM_CONFIG_PREFIX=/root/.npm-global NODE_PATH=/root/.npm-global/lib/node_modules npm list -g --depth=0 jslint'
- 'sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm NPM_CONFIG_PREFIX=/root/.npm-global NODE_PATH=/root/.npm-global/lib/node_modules npm list -g --depth=0 node-sass'
- 'sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm NPM_CONFIG_PREFIX=/root/.npm-global NODE_PATH=/root/.npm-global/lib/node_modules npm list -g --depth=0 yo'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be tested by wrapping everything in bash --login -c?

@thom8 thom8 force-pushed the global_dir branch 3 times, most recently from 710ccc3 to bc45c36 Compare June 2, 2016 13:30
@geerlingguy geerlingguy merged commit 797ebf7 into geerlingguy:master Jun 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DrupalVM 2.5.1 Issues with NPM Packages
3 participants