chef_client: better default chef_server_url location?


#1

Joshua,

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?

Ringo


#2

Joshua,

On 8 February 2011 11:30, Ringo De Smet ringo.desmet@gmail.com 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


#3

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

On 8 February 2011 11:30, Ringo De Smet ringo.desmet@gmail.com 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


#4

Dan,

On 10 February 2011 17:08, Daniel DeLeo dan@kallistec.com wrote:

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

Done: https://github.com/opscode/cookbooks/pull/60

Cheers,

Ringo