- From: Adam Jacob <
>
- To:
- Subject: [chef] Re: Re: Converging Attributes before first chef-client run
- Date: Tue, 21 Dec 2010 17:34:40 -0800
Don't forget about 'knife exec', too, for similar crazy scripting antics.
Adam
On Tue, Dec 21, 2010 at 5:03 PM, Jonathan Matthews
<
>
wrote:
>
Well, answering my own question after a ludicrously short amount of
>
investigation (seriously, whoever wrote/hacked-on shef: the beers are
>
on me the next time you're in town!):
>
>
On 22 December 2010 00:21, Jonathan Matthews
>
<
>
>
wrote:
>
[snip]
>
> * How can I coalesce the set of Attributes inherited by an as-yet
>
> inbuilt Node from its Roles and make it as equally accessible as those
>
> Attributes from *already-running* Nodes?
>
[snip]
>
> * Is shef the way forward? (The wiki page seems to rule out loading
>
> Roles...)
>
>
Yes, shef is (the|an) answer! The wiki page will be getting a few
>
updates tomorrow (mainly the display of the help text), but here's
>
what I've just verified works:
>
>
---------------------------------------------------------------
>
:~/.chef$
>
NODE=my.host.fqdn.at.work ; echo "become_node
>
'"$NODE"' ; node.save " | shef --client
>
loading configuration: /home/jcm/.chef/shef.rb
>
Session type: solo
>
Loading.......done.
>
>
This is shef, the Chef shell.
>
Chef Version: 0.9.12
>
http://www.opscode.com/chef
>
http://wiki.opscode.com/display/chef/Home
>
>
run `help' for help, `exit' or ^D to quit.
>
>
Ohai2u
>
>
chef > become_node 'my.host.fqdn.at.work' ; node.save
>
Loading.....done.
>
>
=> <Chef::Node:0x3fa3b09646bc @name="my.host.fqdn.at.work">
>
---------------------------------------------------------------
>
>
At that point, Roles nested to (in my case) the 4th level were
>
correctly saved back to the Node.
>
>
There's obviously scripting to do around figuring out which hosts need
>
that bit of help pre-build, but I'm so impressed with shef - what a
>
brilliant tool!
>
>
Jonathan
>
--
>
Jonathan Matthews
>
London, UK
>
http://www.jpluscplusm.com/contact.html
>
--
Opscode, Inc.
Adam Jacob, CTO
T: (206) 508-7449 E:
Archive powered by MHonArc 2.6.16.