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


Chronological Thread 
  • From: Ranjib Dey < >
  • To:
  • Subject: [chef] Re: script to change node's environment works in shef but not w/knife exec
  • Date: Mon, 9 Jan 2012 19:12:44 +0530

query=ARGV[2]
new_environment=ARGV[3]

?

On Mon, Jan 9, 2012 at 6:09 PM, Bryan Berry < "> > wrote:
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.

§