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?
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.
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.
A cleaner more concise way is shown on the Attributes wiki page:
node.name
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With