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

Proxy support for test-kitchen (vagrant adapter) #64

Closed
jperville opened this issue Apr 23, 2014 · 7 comments
Closed

Proxy support for test-kitchen (vagrant adapter) #64

jperville opened this issue Apr 23, 2014 · 7 comments

Comments

@jperville
Copy link
Contributor

Hello @tmatilai,

It took me a while to understand how to configure chef running in test-kitchen to use my proxy settings. Unlike in #21 there is no special provisioner that can be detected in config.vm.provisioners then configured.

After reading test-kitchen/kitchen-vagrant#90 and especially @esciara's comments, I ended up putting the following content in my ~/.kitchen/config.yml.

---
provisioner:
  solo_rb:
    http_proxy: http://10.0.3.84:3128
    https_proxy: http://10.0.3.84:3128
    no_proxy: localhost,127.0.0.1
  client_rb:
    http_proxy: http://10.0.3.84:3128
    https_proxy: http://10.0.3.84:3128
    no_proxy: localhost,127.0.0.1

This should work with both the chef_zero and chef_solo provisioners that are used under the hood by the vagrant adapter for test-kitchen.

It would be nice to have vagrant-proxyconf detect when it is running through kitchen-vagrant (test-kitchen's vagrant adapter) and fill these attributes automatically.

@tmatilai
Copy link
Owner

Hi Julien,

Bad news: As test-kitchen doesn't use Vagrant's Chef provisioners, but invokes Chef directly over SSH, #21 has no effect.

Bad news: As test-kitchen shells out to invoke Vagrant, we don't have any access to it's configuration. At the time vagrant-proxyconf kicks in, the config file has been already evaluated, so we can't even try dirty tricks for manipulating it at run time.

Good news: I'm quite sure #58 will fix this too. I'll leave this open so we remember to verify it.

@johnbellone
Copy link
Contributor

@tmatilai I actually have this working locally.

@johnbellone
Copy link
Contributor

I made a modification to test-kitchen in my pull request feel free to confirm it.

@tmatilai
Copy link
Owner

Oh, I also forgot that Chef doesn't even read http_proxy etc. environment variables, so #58 doesn't help with Chef Server API calls, remote_file resources, etc. But still it would help with the omnibus installer at least.
So anyway you will need to configure test-kitchen directly until CHEF-4609 is fixed.

@jperville
Copy link
Contributor Author

Thank you @johnbellone for the test-kitchen pull request, it will make my live much easier (I live in a developing country where we have 20k/s Internet... when it works). @tmatilai yes, chef does not honor http_proxy environment variables yet, so have to configure it explicitly in client.rb.

@tmatilai
Copy link
Owner

tmatilai commented Jul 3, 2014

I'm closing this as #58 is implemented and released, and there isn't much more we can do in this plugin.

Another good news is that Chef 11.14 should finally support environment variables.

@tmatilai tmatilai closed this as completed Jul 3, 2014
@andreamaruccia
Copy link

such an hard time to get this working :/ thx @jperville for the ~/.kitchen/config.yml sample

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

4 participants