chef-infraohai-gem

Access the Chef client/node name within an Ohai plugin


I'm trying to access node.name from a custom Ohai plugin. This doesn't seem to be available by default.

It is possible to grab the hostname by depending on that attribute with depends 'hostname', but this value may not always match that of node.name in my situation.

How can I access the node.name from a custom Ohai plugin?


Solution

  • This isn't possible. Ohai can run outside of the context of Chef, so it doesn't know anything about Chef-specific data.