Ohai and Chef

I’ve installed a Chef server by downloading/curling a package from
opscode.com. I’ve installed Chef clients by downloading a Debian package
from the same page, copying and installing it on a number of VMs. I’m
pleased by the relative success I’m achieving in using Chef.

I’m pretty sure that what I’m doing is not what’s called Chef Solo,
which as I understand it, is using opscode somehow in place of managing
my own Chef server.

In http://docs.opscode.com/essentials_nodes_chef_run.html, I see
something called Ohai, and I’ve heard it referenced in this group forum,
read about it in references in documentation here
http://docs.opscode.com/ohai.html and there
http://community.opscode.com/cookbooks/ohai. I don’t have
//etc/chef/ohai_plugins/ yet. Etc.

  1. What is the significance of Ohai?
  2. Is it “just there”?
  3. Why single it out a name in the first place rather than it just
    being “Chef”?
  4. Is it something that wasn’t there originally?
  5. If I’m not explicitly listing it as a cookbook/recipe in my runs, am
    I nevertheless using it anyway?

Thanks for any comments–I’m still as green as they come at this Chef stuff.

Russ

On Tuesday, September 10, 2013 at 9:37 AM, Russell Bateman wrote:

I've installed a Chef server by downloading/curling a package from opscode.com (http://opscode.com). I've installed Chef clients by downloading a Debian package from the same page, copying and installing it on a number of VMs. I'm pleased by the relative success I'm achieving in using Chef.

I'm pretty sure that what I'm doing is not what's called Chef Solo, which as I understand it, is using opscode somehow in place of managing my own Chef server.

In Chef Infra Client Overview, I see something called Ohai, and I've heard it referenced in this group forum, read about it in references in documentation here (About Ohai) and there (http://community.opscode.com/cookbooks/ohai). I don't have /etc/chef/ohai_plugins yet. Etc.
What is the significance of Ohai?
Is it "just there"?
Why single it out a name in the first place rather than it just being "Chef"?
Is it something that wasn't there originally?
If I'm not explicitly listing it as a cookbook/recipe in my runs, am I nevertheless using it anyway?

Thanks for any comments--I'm still as green as they come at this Chef stuff.

Russ
Ohai is a thing that profiles your system--what OS/distro are you on, are you on a cloud, what does your networking look like, etc. Chef uses it as a library, but it can also be used as a standalone application. And it can be used outside of chef in any situation where you need to know those kinds of things about a system.

You can run ohai directly by (I believe this is the right path) /opt/chef/embedded/bin/ohai and see the data it finds about your system.

HTH,

--
Daniel DeLeo

On Sep 10, 2013, at 11:37 AM, Russell Bateman russ@windofkeltia.com wrote:

I'm pretty sure that what I'm doing is not what's called Chef Solo, which as I understand it, is using opscode somehow in place of managing my own Chef server.

Chef-solo is a mix of chef-client and chef-server, and allows you to run Chef recipes without needing to connect to a chef-server. It gives you a fully and completely self-contained implementation of a simplified system.

In Chef Infra Client Overview, I see something called Ohai, and I've heard it referenced in this group forum, read about it in references in documentation here and there. I don't have /etc/chef/ohai_plugins yet. Etc.
• What is the significance of Ohai?

Ohai is used to discover what is installed on a machine and how it is configured. Puppet has a similar tool called "facter". These kinds of tools can be useful in their own right, although they are a critical component of systems like Chef and Puppet.

See http://docs.opscode.com/ohai.html for more information.

• Is it "just there"?

It is there, but I wouldn't use the word "just" in connection with Ohai. It is a vital component of Chef.

• Why single it out a name in the first place rather than it just being "Chef"?

IIRC, it is maintained separate from the rest of the Chef codebase, in part so that upgrades and changes can be made to Ohai that do not require you to update the entire chef-client system.

• Is it something that wasn't there originally?
• If I'm not explicitly listing it as a cookbook/recipe in my runs, am I nevertheless using it anyway?

Running Ohai is the first thing done as part of a chef-client or chef-solo run, so there is no escaping it. Like it or not, if you're using chef-client or chef-solo, then you're using Ohai. Consider yourself lucky, because Ohai ends up having to do some pretty whacky and wild things in order to get all the information it does.

Thanks for any comments--I'm still as green as they come at this Chef stuff.

Generally speaking, most questions you have are likely to be answered in the Chef documentation. Your first stop for information should be at http://docs.opscode.com/, and don't forget the search interface at http://docs.opscode.com/search.html if you don't find any obvious links from that main page.

--
Brad Knowles brad@shub-internet.org
LinkedIn Profile: http://tinyurl.com/y8kpxu