Use an `only_if` guard instead of vanilla Ruby

Like it says on the tin; more Chef-like.

This is a bit of an opinionated change, so feel free to not merge it if you disagree.