سؤال

I'm using Vagrant to deploy chef scripts to an AWS server (and it mostly works awesome). I have set up a local rsync in my Vagrantfile to mirror my dev directory onto the server.

config.vm.synced_folder "../geoevents", "/vagrant/geoevents-repo"

And this syncs find on 'vagrant provision'. I'm wondering if there is an easier way that I can have vagrant only trigger that rsync, or to control how often rsync occurs?

Or, should I not be using rsync, but instead mount a shared file system?

هل كانت مفيدة؟

المحلول

Vagrant CLI now has two new commands, vagrant rsync and vagrant rsync-auto which can do the job.

Command: vagrant rsync

This command forces a re-sync of any rsync synced folders.

Note that if you change any settings within the rsync synced folders such as exclude paths, you will need to vagrant reload before this command will pick up those changes.

https://www.vagrantup.com/docs/cli/rsync.html

https://www.vagrantup.com/docs/cli/rsync-auto.html

https://www.vagrantup.com/docs/cli/non-primary.html

نصائح أخرى

Currently, you can fit your needs with the following plugin:

https://github.com/cromulus/vagrant-rsync

By the way, most of the plugin features will be available in Vagrant 1.5 (currently in development).

The vagrant-rsync is deprecated as of Vagrant 1.5. One solution out there is vagrant-unison. You may also check out this discussion. What should also work is a vagrant reload.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top