I'm sure. Chef creates yum cache only once - on the first call to yum_package resource and all subsequent package searches are done in chef cache. So this solution will work only if recipe is the first in a run_list (or the only one). If there is some recipe that installs some yum_package earlier in a run_list - then cache will be already populated and Chef will exit with error that package not found, because new repository is not in the cache.