🚀 DevOps & SRE Certification Program 📅 Starting: 1st of Every Month 🤝 +91 8409492687 🔍 Contact@DevOpsSchool.com

Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!

We spend hours on Instagram and YouTube and waste money on coffee and fast food, but won’t spend 30 minutes a day learning skills to boost our careers.
Master in DevOps, SRE, DevSecOps & MLOps!

Learn from Guru Rajesh Kumar and double your salary in just one year.


Get Started Now!

Chef Tutorials: Working with Ohai


Ohai is a tool for collecting system configuration data, which it then provides to Chef Infra Client to use in cookbooks. Chef Infra Client runs Ohai at the start of every Chef Infra run to determine system state. The attributes that Ohai collects are called automatic attributes. Chef Infra Client uses these attributes to ensure that nodes are in the desired state after each configuration run.

The types of attributes Ohai collects include but are not limited to:

  • Operating System
  • Network
  • Memory
  • Disk
  • CPU
  • Kernel
  • Host names
  • Fully qualified domain names
  • Virtualization
  • Cloud provider metadata

Ohai collects data for many platforms, including

  • AIX,
  • macOS,
  • Linux,
  • FreeBSD,
  • Solaris, and
  • any Windows operating systems.

log "The platform on which a node is running:- #{node['platform']}!" do
level :info
end
log "The platform family is a Chef Infra specific:- #{node['platform_family']}!" do
level :info
end
log "The version of the platform: #{node['platform_version']}!" do
level :info
end
log "The IP address for a node: #{node['ipaddress']}!" do
level :info
end
log "The MAC address for a node: #{node['macaddress']}!" do
level :info
end
log "fully qualified domain name: #{node['fqdn']}!" do
level :info
end
log "The host name for the node: #{node['hostname']}!" do
level :info
end
log "The domain for the node: #{node['domain']}!" do
level :info
end
log "A list of recipes associated with a node: #{node['recipes']}!" do
level :info
end
log "The time at which Ohai was last run: #{node['recipes']}!" do
level :info
end
view raw Ohai.rb hosted with ❤ by GitHub
Subscribe
Notify of
guest


0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments

Certification Courses

DevOpsSchool has introduced a series of professional certification courses designed to enhance your skills and expertise in cutting-edge technologies and methodologies. Whether you are aiming to excel in development, security, or operations, these certifications provide a comprehensive learning experience. Explore the following programs:

DevOps Certification, SRE Certification, and DevSecOps Certification by DevOpsSchool

Explore our DevOps Certification, SRE Certification, and DevSecOps Certification programs at DevOpsSchool. Gain the expertise needed to excel in your career with hands-on training and globally recognized certifications.

0
Would love your thoughts, please comment.x
()
x