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

Add --rsync option to vagrant provision #5850

Closed
yoshiwaan opened this issue Jun 19, 2015 · 11 comments
Closed

Add --rsync option to vagrant provision #5850

yoshiwaan opened this issue Jun 19, 2015 · 11 comments

Comments

@yoshiwaan
Copy link

Hi,

Providers that rsync data from the local machine to a remote machine in vagrant instead of mounting, such as vagrant-aws, don't play nicely with provisioners that need to keep data up to date outside of the /vagrant directory.

As a specific example, when running vagrant-berkshelf on an instance in ec2 created using vagrant-aws, running vagrant provision does not update any cookbook versions on the instance. This is because the data is synced to /tmp/vagrant-chef//cookbooks and is not synced when provisioning.

When vagrant provision is run only the /vagrant directory is rsynced. It would be good to add a --rsync option to the vagrant provision action so that all synced folders for the instance are synced (at the point directly after the /vagrant directory is rsynced).

Here are a couple of cases related to this, as I'm not sure where the correct location for this fix is. This seemed like a good general solution:

berkshelf/vagrant-berkshelf#281
berkshelf/vagrant-berkshelf#284
mitchellh/vagrant-aws#385

@beddari
Copy link

beddari commented Sep 29, 2015

This is a long standing issue across a lot of different plugins with duplicated code so I'd very much like a solution to this as part of core. For people coming from a simple vagrant setup (virtualbox+shared folders) to a more developed one (e.g multiple external providers) the fact that provision doesn't rsync breaks expectations.

@yoshiwaan
Copy link
Author

@sethvargo
If I could add an extra comment on this.
Although it's more difficult to implement it might be more useful to set a flag against each synced folder to state whether it's for provisioning (in the synced folders config file), and only sync those when running provision.
I'm sure there are use cases out there where people don't want to initiate a full sync for all synced folders on each provision.

@chrisroberts
Copy link
Member

Hi there,

We would really like this, but this issue has been open for over a year with no one working on it, Leaving it open is unfortunately making our issue count look higher than it is. I’m going to close this and if someone wants to work on it I’d still be open to a PR!

Cheers!

@PierrePaul
Copy link

Leaving it open is unfortunately making our issue count look higher than it is.

Closing valid issues to reduce the issue count is the way forward for vagrant now?

@beddari
Copy link

beddari commented Jan 9, 2017

@PierrePaul That comment is not warranted - you are making yourself look bad. It is clearly stated that this feature is something they'd be open to add but that they are not working on it right now.

@yoshiwaan
Copy link
Author

Is it still on a backlog somewhere if the issue is closed?

@nschlemm
Copy link

while it is still on the backlog (somewhere?!?) a usable workaround is using the vagrant-triggers plugin

config.trigger.before :provision do
    run "vagrant rsync"
end

@briancain
Copy link
Member

Hi @nschlemm - actually in the next release the trigger functionality will be a core feature of Vagrant, so you won't need the plugin at all! It should just work.

@nschlemm
Copy link

@briancain thanks for the info! while that is definitely interesting news, I also must say I'm not a fan of how this issue was handled ...

@mpictor
Copy link

mpictor commented Nov 27, 2018

not a fan of how this issue was handled

No kidding. The person who points out issues are being closed apparently to make vagrant look better is making themselves look bad and their comment is unwarranted?

No.

A thousand times no.

If someone dislikes being called out for doing things, then the solution is to not do them. If that's untenable, then they need to take the criticism.

If I am making myself look bad by following in the footsteps of PierrePaul, then please, call me out... though I'll need a more detailed explanation of how this makes me look bad. And if you really want to, add me to some private or public list of bad people... as long as you also link to this discussion verbatim so that those reading the list know the crime I'm guilty of.

@ghost
Copy link

ghost commented Mar 28, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Mar 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants