Closed jperville closed 9 years ago
Hi, @jperville Thank you for reporting with your use case. I will check it and try to find ways to solve it.
Thank you very much @otahi
Yeah, I like to avoid too many configuration options, but maybe we really need one here. Should be straightforward to add one.
I think disabling function is needed in these cases.
@tmatilai
How about adding disabling function selection toconfig.proxy.enabled
like this?
Or adding new options or any ideas?
The plugin can be totally skipped by setting config.proxy.enabled
to false
or empty string (""
). This can be useful to for example disable it for some provider.
Vagrant.configure("2") do |config|
config.proxy.http = "http://192.168.0.2:3128/"
config.vm.provider :my_cloud do |cloud, override|
override.proxy.enabled = false
end
# ... other stuff
end
The plugin can be totally skipped by setting config.proxy.enabled
to false
or empty string (""
). This can be useful to for example disable it for some provider. You can also specify disabling applications.
Vagrant.configure("2") do |config|
config.proxy.http = "http://192.168.0.2:3128/"
config.vm.provider :my_cloud do |cloud, override|
override.proxy.enabled = false
end
config.vm.provider :my_company do |cloud, override|
override.proxy.enabled = { docker: false }
end
# ... other stuff
end
Hi @jperville,
I'm sorry that I don't have enough time to realize above solution. Because there are lots of configuration for lots of functions. Now, I'm thinking about this problem again. This problem is caused by restarting docker. But this restarting is not necessary if there is no difference between old configuration and new one. So it can be inhibited when no difference. If it can be a solution, I want to make this change first. (I have not tried..)
How about this kind of modification:
comm.sudo("mv #{path}.new #{path}")
comm.sudo("rm #{tmp}")
comm.sudo(service_restart_command)
:arrow_down:
comm.sudo("diff #{path}.new #{path} > /dev/null || (mv #{path}.new #{path} ; #{service_restart_command})")
comm.sudo("rm #{tmp}")
Hi @otahi,
Your proposal would prevent the docker daemon from restarting if the daemon is already running and the /etc/default/docker
file is altered by the vagrant proxyconf plugin.
However, it would still be broken in my case, because the problem is not that the vagrant-proxyconf plugin explicitly restarts or not the docker daemon, but rather that it adds extra text in a configuration file (/etc/default/docker
) that I am managing with my own provisioner (chef).
Since the file is modified to add the proxy lines just before the provisioner (chef) starts, the provisioner will always think that the file has changed, overwrite its contents with the managed content (without the proxy exports) and restart the docker daemon, which breaks my containers.
I don't see any better way than allowing to disable the docker proxies in vagrant proxyconf, or (if not possible) stick to version 1.3.2 which does not support docker proxies.
Thank you very much for caring about my issue.
Hi @jperville,
I understand the above solution is not enough for you. But I think it should be modified. Anyway, I will continue to think with disabling functions.
Thank you.
Hi @otahi, go for it, your proposal is useful, just not enough me for as you said. Thank you very much!
Closed by #92 and #93.
I investigated why my chef-solo provisioned Vagrant box was restarting the docker daemon at every
vagrant provision
until I found out about the docker support in vagrant-proxyconf (see #69).Here is what happened:
vagrant provision
is invoked by the user/etc/default/docker
To avoid this situation, I would like to have an option to explicitly disable the docker proxy feature of vagrant-proxyconf, while keeping all the others working (apt, chef file cache etc). I through, after reading the code, that setting something like
config.docker_proxy.http = false
in myVagrantfile
would work, but it does not since the docker plugin uses the genericconfig.proxy.http
which I don't want to disable.My vagrant plugin skills (and my free time for now) are quite limited, so as a workaround I reverted my vagrant-proxyconf plugin to version 1.3.2, but in the long run I'd love to be able to disable a proxy explicitly without affecting the others.