[chef] Re: Node won't stay in configured environment


Chronological Thread 
  • From: Benoit Caron < >
  • To: Steven Danna < >
  • Cc:
  • Subject: [chef] Re: Node won't stay in configured environment
  • Date: Thu, 20 Oct 2011 14:30:06 -0400

On Thu, Oct 20, 2011 at 2:20 PM, Steven Danna < "> > wrote:
On Thu, Oct 20, 2011 at 11:16 AM, Benoit Caron < " target="_blank"> > wrote:
I have this node I want to change from my "preproduction" to "production" chef environment.

If I edit the node in the Web UI, when I submit the form it says that my node is in the correct environment. But if I recheck the node list or refresh the node list, it still says "preproduction".

If I use knife like this:

knife exec -E 'nodes.transform("name:my-node-name-in-chef") { |n| n.chef_environment("production") }'

and then do a 

knife node show my-node-name-in-chef

It still say "preproduction" too... except that odd time when it DID said production, as expected... but got back to "preproduction" on next call to knife node show.

Is it possible that you have the environment set in /etc/chef/client.rb on that node and that the node is running chef-client very frequently? 


client.rb is very slim, as configured by knife bootstrap:

 $ cat /etc/chef/client.rb 
log_level        :info
log_location     STDOUT
chef_server_url  "http://chefserver/"
validation_client_name "chef-validator"
# Using default node name (fqdn)

But I think the init.d configuration for chef is somewhat broken: the interval seems to be missing in the running chef-client process:

/usr/bin/ruby1.8 /usr/bin/chef-client -d -P /var/run/chef/client.pid -L -c -i -s

An empty -i value would make my node continuously converge?

It make sense: after stopping chef-client on the node, I can use knife to change the environment while not being overwritten.

This is under Debian Squeeze, looks like the init.d is incorrect? 



Archive powered by MHonArc 2.6.16.

§