On Thu, Apr 5, 2012 at 11:28 AM, email@example.com wrote:
Is there a way to replace the “attributs” of an existing node in a
non-interactive mode, using knife or another utility please ?
I can see in the documentation that there are the two following knife
- node edit NODE (options)
Edit a node.
- node from file FILE (options)
Create a node from a JSON file.
But my need is to ‘edit’ the attributs of an existing node ‘from a file’, so
a kind of merge of this two features
You can use knife node show with -Fj to dump a node to a JSON file.
knife node show mynode.example.com -Fj > nodes/mynode.example.com.json
Then edit the JSON file as you need and upload it to the server.
knife node from file nodes/mynode.example.com.json
You could also use a “knife exec” script to modify the node with the
same DSL available to shef’s main context.
Joshua Timberman, Technical Program Manager
IRC, Skype, Twitter, Github: jtimberman