[chef] Re: Re: chef_client: better default chef_server_url location?


Chronological Thread 
  • From: Daniel DeLeo < >
  • To:
  • Subject: [chef] Re: Re: chef_client: better default chef_server_url location?
  • Date: Thu, 10 Feb 2011 08:08:53 -0800

On Tuesday, February 8, 2011 at 6:37 AM, Ringo De Smet wrote:

Joshua,

On 8 February 2011 11:30, Ringo De Smet < "> > wrote:

I am trying the chef_client cookbook. The default chef_server_url is
default localhost:4000. Wouldn't a better default URL be just the
server location that the client is communicating with? Since the
client is first registered with the server, I would expect that this
location can be retrieved somewhere by the cookbook during the compile
phase, no?

The bootstrapping chef client running the chef-client cookbook is in
my case running against a server, which means that it has the
:chef_server_url configured. I have updated my client.rb.erb template
to:

<% if Chef::Config.has_key?(:chef_server_url) -%>
chef_server_url "<%= Chef::Config[:chef_server_url] %>"
<% else -%>
chef_server_url "<%= node["chef_client"]["server_url"] %>"
<% end -%>

This takes over the setting for my /etc/chef/client.rb file. Works
like a charm for me against Opscode Platform (my test env) and my own
Chef production server.

Ringo
Can you make a ticket and/or pull request for this? I've been bitten by this one when helping users on IRC.

-- 
Dan DeLeo




Archive powered by MHonArc 2.6.16.

§