- From: Daniel DeLeo <
>
- To:
- Subject: [chef] Re: Re: Re: Re: Re: Re: Converging Attributes before first chef-client run
- Date: Mon, 27 Dec 2010 12:14:59 -0700
>
> You can probably achieve your goal of getting the attributes to be
>
> applied using something like this:
>
>
>
> knife exec -E 'n = nodes.show("i-ec308f81"); n.expand!; n.save'
>
>
That's brilliant - a great (and fast!) one-liner to achieve almost
>
exactly what I need :-)
>
>
Poking at it for few minutes, I notice an interesting departure from
>
shef's "become_node; node.save" behaviour: the knife call doesn't
>
/remove/ attributes that've been deleted from included (in my case,
>
nested) roles. Is this by design?
You need to add a call to Node#reset_defaults_and_overrides
Note also that you can write your knife exec scripts as a file and run
them with `knife exec path/to/script.rb`. There's not any elegant way
to pass arguments to these scripts but you can use environment
variables, so you could do `NODE_NAME=foo knife exec myscript.rb` and
get the node name in the script via ENV['NODE_NAME']`
>
>
Jonathan
Dan DeLeo
Archive powered by MHonArc 2.6.16.