tmatilai / vagrant-proxyconf

Vagrant plugin that configures the virtual machine to use proxies
MIT License
531 stars 74 forks source link

proxy to be setup before GuestDebian comes in #205

Open greut opened 5 years ago

greut commented 5 years ago

Heya,

Playing with Vagrant on Windows (yes I know), it'd nice if the proxyconf hook could run before it tries on install any missing deps, here cifs.

https://github.com/hashicorp/vagrant/blob/master/plugins/guests/debian/cap/smb.rb

Any idea if the existing hooks list could be amended to cover that use case too?

Cheers, (ping @marcaurele)

codylane commented 5 years ago

Hey @greut - Hope as is well with you. Thanks for taking the time to make a suggestion and or report this behavior.

I'm honestly not sure I know how to solve this off the top of my head and will require me to do a little more research. The docs surrounding how to go about this are confusing and or non-existent so it may take some trial and error to figure out.

I suspect what we will need to do is inject our plugin before other plugins and I wonder if we will be able to accomplish this as a "hook"? Here's some docs. I could use some help with coming up with a solution to this and I hope we can use this thread to report our findings.

I also wonder if this line of code is where we would need to inject a new if statement to run before configuring nfs smb and rsync. https://github.com/tmatilai/vagrant-proxyconf/blob/master/lib/vagrant-proxyconf/hook.rb#L32?

codylane commented 4 years ago

Hey @greut - Just curious can you share your Vagrantfile with me. I have an idea I want to try and I have a feeling that if you put your synced_folder later down in your Vagrantfile presumably after vagrant-proxyconf executes any provisioner you should be good to go. It's just a hunch and I have not tested it, it was just something I was thinking about and thought I would at least comment.

greut commented 4 years ago

I'll see if I have this somewhere... or will close it. Thanks for the heads up.

codylane commented 4 years ago

Hey @greut,

I hope you are doing well and you are having a good week so far. I'm starting to contribute to the vagrant-sshfs plugin as I use it almost daily and I use it heavily when running our integrations tests for this plugin, so that said, I've got an example Vagrantfile that installs and configures the synced_folder mount during the provisioning process and I would be curious if you could give this a shot with the cifs synced_folder?

Here's a link to the issue and and example Vagrantfile https://github.com/dustymabe/vagrant-sshfs/issues/104

codylane commented 4 years ago

I think I might have just figured out how to create a pre-hook while stumbling through some different API docs over the weekend. I'll see if I can address this soon.