Access the Chef client/node name within an Ohai plugin

185 Views Asked by At

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?

1

There are 1 best solutions below

1
On BEST ANSWER

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