- 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 16:38:43 +0100
hmm,
I see no error messages, none at all. I will look at this again
tks Steve
On Mon, Jan 9, 2012 at 4:36 PM, Steven Danna
<
>
wrote:
>
Hi,
>
>
On Mon, Jan 9, 2012 at 4:39 AM, Bryan Berry
>
<
>
>
wrote:
>
> This is very strange. Am I doing something that can't be accomplished
>
> with knife exec?
>
>
Do you get any error messages? How are you determining that the
>
environment isn't being changed?
>
>
> query = ARGV[0] # i type this in when using shef
>
> new_environment = ARGV[1]
>
>
On recent versions of Chef, this should be ARGV[2] and ARGV[3] as Ranjib
>
said.
>
>
> my_nodes = search(:node, "#{query}")
>
>
>
> my_nodes.each do |n|
>
> n.chef_environment new_environment
>
> n.save
>
> end
>
>
>
> exit 0
>
>
I tested this basic script using Chef 0.10.8 and it worked as far as I
>
could tell.
>
>
Cheers,
>
>
Steven
Archive powered by MHonArc 2.6.16.