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


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

I hard code those values when i use them in shef

On Mon, Jan 9, 2012 at 2:42 PM, Ranjib Dey 
< >
 wrote:
> 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.

§