Vagrant: Add --rsync option to vagrant provision

Created on 19 Jun 2015  ·  11Comments  ·  Source: hashicorp/vagrant

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:

https://github.com/berkshelf/vagrant-berkshelf/issues/281
https://github.com/berkshelf/vagrant-berkshelf/issues/284
https://github.com/mitchellh/vagrant-aws/issues/385

core enhancement

Most helpful comment

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

All 11 comments

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.

@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.

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!

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?

@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.

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

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

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.

@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 ...

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.

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Cbeck527 picture Cbeck527  ·  3Comments

OtezVikentiy picture OtezVikentiy  ·  3Comments

hesco picture hesco  ·  3Comments

bbaassssiiee picture bbaassssiiee  ·  3Comments

lebogan picture lebogan  ·  3Comments