Bug found in yum module (and the fix)

I just faced an incredible bug in yum module.

When you use state=latest with an enablerepo directive AND yum-utils package is not installed on target server, yum will not update any packages saying everything is up to date.

I spent at least 2 hours looking at the code and trying. All this to finally find a typo in the code. Since i was on a pretty old version of ansible, i checked on devel branch on github and the typo is still there. So surprising this case has not been discovered so far.

Here is the fix : GH8988

That’s amusing.

Ultimately the yum module has two paths to account for reposync being missing – I think the reason most don’t encounter it is because reposync is almost always there.

We used to have this discussion a lot in the past - Seth wanted one code path, I wanted to make sure it worked in the non-reposync case as well.

Regardless, we’ll merge this - I appreciate your fix.