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

Allow non privileged user vagrant to run a shell provision #1370

Merged
merged 1 commit into from
Aug 29, 2013
Merged

Allow non privileged user vagrant to run a shell provision #1370

merged 1 commit into from
Aug 29, 2013

Conversation

frsantos
Copy link
Contributor

Sometimes, after provisioning the server, I need to make some initial configurations in the project, without superuser privileges. For example, bundle the project gems, import assets and/or db data from the integration server, etc. Some of these tasks are better performed by the user vagrant, and some of them don't even work when performed by root (because of ssh agent forwarding lost after sudo'ing and su'ing).

This pull request allows a shell provision by the unprivileged vagrant user:

config.vm.provision :shell, :path => 'path/to/my/script', :privileged => false

@kynan
Copy link

kynan commented Mar 2, 2013

That'd be really great to have, please consider merging this.

@philippgerard
Copy link

Yes, please - I need that feature, too.

@johnbellone
Copy link
Contributor

+1 I definitely need this feature!

@danielpcox
Copy link

bump

@johnbellone
Copy link
Contributor

This actually would be greatly useful to be in master.

Right now I actually need to drop out of provisioning to perform a deploy with capistrano. If this was here it'd be a nice and easy pattern to first deploy with Chef using Vagrant, and then have a final step which executes a local capistrano deploy.

This is obviously only a single use case and just so happens to be the one that I have. But I am sure there are many other options we could consider. Executing as a separate role account other than vagrant?

@kretes
Copy link

kretes commented May 27, 2013

+1 some provisioning operations needs to be executed as non-root user, it would be good to have it in vagrant instead of doing sudo in the scripts

@styx
Copy link

styx commented Jun 19, 2013

👍

IMHO: might be you should add some acceptance test here?

@parshap
Copy link

parshap commented Jul 18, 2013

👍 For ssh agent forwarding and explicit sudo

It seems that @mitchellh originally intended for the non-privileged vagrant user to be the default shell provisioner (#105 (comment)) but later forgot about it (#482 (comment)).

It may be too late to change the default behavior, but an option like this would be useful.

@AdamMagaluk
Copy link

+1 this would really help.

@mitchellh mitchellh merged commit 4a6e7c7 into hashicorp:master Aug 29, 2013
@mitchellh
Copy link
Contributor

Merged. Enjoy!

@frsantos frsantos deleted the unpriv_shell branch August 30, 2013 11:39
@Varadinsky Varadinsky mentioned this pull request Oct 8, 2015
@ghost ghost locked and limited conversation to collaborators Apr 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants