Chef Ohai

A configuration management system will usually provide system facts or some way to detect information about the server that's being configured.
These system facts such as networking interfaces, operating system details or user information can be used to create a generic scripts that run on any system.
In Chef we call system discovery tool - Ohai, and it makes system details available to our Chef code.

Examples:

$ ohai ipaddress
[
  "192.168.121.94"
]
$ ohai hostname 
[
  "buster"
]
$ ohai memory/total
[
  "494792kB"
]
$ ohai cpu/0/mhz   
[
  "2999.998"
]