简体   繁体   中英

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM