Using ohio dmi decode variables for conditional runs

Problem: We have a type of dell server “R710” that we want to run a certain cron on.

Simple conditional that some people may not be aware exist.

Problem: We have a type of dell server “PowerEdge R710” that we want to run a certain cron on.

Solution: We use node[:dmi][:system][:product_name] as a conditional for our cron job

Example: mycookbook/recipes/crons.rb

cron “check_it” do
user “root”
minute “0”
hour “*/4”
day “*”
month “*”
weekday “*”
command “/path/check.sh >> /dev/null 2>&1”
only_if do node[:dmi][:system][:product_name] == “PowerEdge R710” end
end