I’d like to use not_if as part of my package deployment. I’m a bit new to Ruby/Chef and I’m having some trouble getting this to work like I’d like it to. What I’ve ended up doing is creating the not_if in Powershell, this isn’t the most elegant or efficient way to do this since Ohai already knows if the package is installed or not.
Put the test for nil? first in your OR statement. Statements are evaluated lazily, left to right. By the time your code tests for nil? it is already too late.