Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Node Name in Chef Template?

Tags:

I've been trying to figure out how to get the node's name (knife bootstrap -N) into a template. I've tried a dozen different ideas and haven't found anything that works yet. Does anyone know how to access this from a Chef recipe?

Also -- is there a way to list all of the variables available to a Chef recipe?

like image 958
erikcw Avatar asked Oct 16 '11 00:10

erikcw


People also ask

What does a node represent in chef?

A node is any machine—physical, virtual, cloud, network device, etc. —that is under management by Chef. A physical node is typically a server or a virtual machine, but it can be any active device attached to a network that is capable of sending, receiving, and forwarding information over a communications channel.

What are chef-client nodes?

A node is just a generic name for a device that is capable of running the chef-client. So a node could be a physical server, an on-prem or cloud based cloud based virtual machine, a network device such as a switch or router, and even containers.


1 Answers

A cleaner more concise way is shown on the Attributes wiki page:

node.name 
like image 183
jarrad Avatar answered Oct 19 '22 22:10

jarrad