How to get node file from server

Hello,

I have a local chef git repository with several node files in it. If I
run ‘knife status’, then the (opscode) chef server shows that there is a
server for which we do not have a node file. (The server exists, is up
and running, and is running ‘chef-client’ locally with no problems.)

My question is this, since the chef server must have had a copy of the
node file at some time - either through ‘knife node create’ or from a
local file using ‘knife node from file’ - is it possible to ask the chef
server for a copy of that file?

I have looked at the ‘knife download’ command but it doesn’t seem to do
anything in this case. That is, if I run 'knife download '
nothing happens, it just returns to the command prompt. Nothing is
downloaded. I have also looked at the git logs, and can see no
indication of the node file ever being seen by git.

Knife version is 11.12.8.

Thanks,

John.


John Horne Tel: +44 (0)1752 587287
Plymouth University, UK

knife node show -Fj nodename > nodename.json ?

--
~~ StormeRider ~~

"Every world needs its heroes [...] They inspire us to be better than we
are. And they protect from the darkness that's just around the corner."

(from Smallville Season 6x1: "Zod")

On why I hate the phrase "that's so lame"... http://bit.ly/Ps3uSS

On Thu, Jun 19, 2014 at 9:33 AM, John Horne john.horne@plymouth.ac.uk
wrote:

Hello,

I have a local chef git repository with several node files in it. If I
run 'knife status', then the (opscode) chef server shows that there is a
server for which we do not have a node file. (The server exists, is up
and running, and is running 'chef-client' locally with no problems.)

My question is this, since the chef server must have had a copy of the
node file at some time - either through 'knife node create' or from a
local file using 'knife node from file' - is it possible to ask the chef
server for a copy of that file?

I have looked at the 'knife download' command but it doesn't seem to do
anything in this case. That is, if I run 'knife download '
nothing happens, it just returns to the command prompt. Nothing is
downloaded. I have also looked at the git logs, and can see no
indication of the node file ever being seen by git.

Knife version is 11.12.8.

Thanks,

John.

--
John Horne Tel: +44 (0)1752 587287
Plymouth University, UK

also ‘knife download /nodes/foo-app-101.example.com’ (or however you
name your nodes…)

On Thu, 2014-06-19 at 09:39 -0700, Morgan Blackthorne wrote:

knife node show -Fj nodename > nodename.json ?

Excellent. Thanks for that, it was just what I wanted.

John.

--

John Horne Tel: +44 (0)1752 587287
Plymouth University, UK

On Thu, 2014-06-19 at 11:07 -0700, Lamont Granquist wrote:

also 'knife download /nodes/foo-app-101.example.com' (or however you
name your nodes....)

Sorry, but I just can't get this to work at all. It doesn't give an
error on the terminal, it gives no output at all. It doesn't create the
node file anywhere.

John.

--

John Horne Tel: +44 (0)1752 587287
Plymouth University, UK

sorry, it needs a .json on the end:

knife download /nodes/foo-app-101.example.com.json

or just 'knife download /nodes' to get them all

it should try to stick them in your chef-repo alongside your cookbooks,
databags, etc (based on your knife.rb settings).

On Thu Jun 19 14:48:50 2014, John Horne wrote:

On Thu, 2014-06-19 at 11:07 -0700, Lamont Granquist wrote:

also 'knife download /nodes/foo-app-101.example.com' (or however you
name your nodes....)

Sorry, but I just can't get this to work at all. It doesn't give an
error on the terminal, it gives no output at all. It doesn't create the
node file anywhere.

John.

https://rubygems.org/gems/knife-backup

This might help you in taking backup of the file