Use recommended practice of only_if to add yum repositories.

Foodcritic recommends using only_if instead of if conditions to conditionally include resources
http://acrmp.github.io/foodcritic/#FC023

Additionally this also means the node configuration can be changed after compile-time.