Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

chef knife command to show all attributes

I am trying to display all attributes for all nodes using a single knife command. I would specifically like to see the attributes set at the normal level

please help

like image 400
Jeetendra Pujari Avatar asked Mar 06 '23 15:03

Jeetendra Pujari


2 Answers

knife node show $name --format json --long. Or the shorter form knife node show $name -Fj -l. (if you just want normal attrs you can also use -m/--medium)

like image 110
coderanger Avatar answered Apr 06 '23 12:04

coderanger


This is a bit tricky, depends on what you want to achieve.

You could fire this query:

knife search node 'name:*' -F j

This will fetch you all nodes and their data in JSON format mind you, but it'd be better if you can think of parameters to filter nodes depending on some attribute. Could be some attribute you set or something like role:WEB

like image 23
Chiranjib Avatar answered Apr 06 '23 11:04

Chiranjib