Node sys parameters validation

Hi All,
i have requirement to validate the pre-requisite before running the recipe on node.

pre-req
is CPU > 4
is RAM > 16 GB
is DeskSpace > 100 GB

only if above condition met proceed with the software installation else break the flow and throw error.

i am planning to make use of ohai attributes for above pre-req.

am i doing right thing here? is that ok to have such kind of pre-req in cookbook before software installation?

While Chef itself doesn’t really have a notion of pre-requisites you could definitely craft a recipe to exit if the Ohai values weren’t of a certain value. Right thing is somewhat difficult to suss out here without more context but this isn’t terrible though may would advocate avoiding this check by ensuring these roles/recipes are not assigned to underpowered nodes.