Setting properties in chef-client.rb

Posted by Stephen C on Server Fault See other posts from Server Fault or by Stephen C
Published on 2012-01-24T00:56:48Z Indexed on 2013/06/25 4:23 UTC
Read the original article Hit count: 479

Filed under:

I have a use-case where a chef recipe needs to use 'remote_file' to fetch a file on a virtual, and the fetch needs to be do through an HTTP proxy. This is not working because chef-client doesn't use the system proxy settings ... it gets its proxy settings from the /etc/chef/chef-client.rb

So how do I get proxy settings (or settings in general) into the chef-client.rb file on a client?

Ideally, I'd like it to happen at client bootstrap time, but I can't see how to do that short of hacking the code.

The other possibility is that I could create a recipe that updates the chef-client.rb file. But that strikes me as a bit dangerous. And it means that you need to run chef-client twice before it works, assuming that the missing proxy setting in the first run causes the run to ultimately fail.

Any ideas on how to fix this?

© Server Fault or respective owner

Related posts about chef