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

The sync_type value in settings.yaml is not honored #1248

Open
apatelKmd opened this issue Dec 15, 2020 · 0 comments
Open

The sync_type value in settings.yaml is not honored #1248

apatelKmd opened this issue Dec 15, 2020 · 0 comments

Comments

@apatelKmd
Copy link

I am using the awesome forklift project as a plugin to quickly test out the Foreman. In my setup I am unable to use the sync_type option and based on the documentation I set it to sync_type: 'disabled'.
However, the above does not work and it always ends up with the default sync_type: 'rsync'. After some investigation, I managed to update the code to honor the documented value disabled.
Below is the diff of my changes which I am happy 😄 to submit a pull request.

diff --git a/vagrant/lib/forklift/box_distributor.rb b/vagrant/lib/forklift/box_distributor.rb
index c087781..fb673fe 100644
--- a/vagrant/lib/forklift/box_distributor.rb
+++ b/vagrant/lib/forklift/box_distributor.rb
@@ -240,7 +240,10 @@ module Forklift
     def configure_libvirt(machine, box, networks = [])
       machine.vm.provider :libvirt do |p, override|
         override.vm.box_url = box.fetch('libvirt') if box.fetch('libvirt', false)
-        override.vm.synced_folder '.', '/vagrant', type: @settings['sync_type'], rsync__args: ['--max-size=100m']
+
+        if @settings.key?('sync_type') and @settings['sync_type'] != 'disabled'
+          override.vm.synced_folder '.', '/vagrant', type: @settings['sync_type'], rsync__args: ['--max-size=100m']
+        end
 
         if box.fetch('bridged', false)
           override.vm.network :public_network, :dev => box.fetch('bridged'), :mode => 'bridge'
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

No branches or pull requests

1 participant