- 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:45:22 +0100
sorry misunderstood your question, ARGV[0] and ARGV[1] are correct. I
guess that knife exec shifts the opts when it passes them to the
script
On Mon, Jan 9, 2012 at 2:44 PM, Bryan Berry
<
>
wrote:
>
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.