[chef] script to change node's environment works in shef but not w/knife exec


Chronological Thread 
  • From: Bryan Berry < >
  • To:
  • Subject: [chef] script to change node's environment works in shef but not w/knife exec
  • Date: Mon, 9 Jan 2012 13:39:46 +0100

This is very strange. Am I doing something that can't be accomplished
with knife exec?

it works perfectly when I run it from shef on my workstation

# usage knife exec ./change_env.rb query environment_name

query = ARGV[0]     # i type this in when using shef
new_environment = ARGV[1]

my_nodes = search(:node, "#{query}")

my_nodes.each do |n|
  n.chef_environment new_environment
  n.save
end

exit 0



Archive powered by MHonArc 2.6.16.

§