Beware: yum module in 1.9.2 batches package installs

Hi Ansible users,

I updated from 1.9.1 to 1.9.2 and was bitten by a fundamental change in the yum module. Previously, if you had a task like this:

  • yum: name={{ item }}
    with_items:
  • epel-release
  • exim
  • python-virtualenv

Then it would work, because Ansible would first use yum to install epel-release (which makes exim and other packages available), and then install the other packages.

However, Ansible >= 1.9.2 is batching updates, and doing something like “yum install epel-release exim python-virtualenv”. This cannot work, because when evaluating this command, the epel repo isn’t yet available, and yum won’t find “exim” and “python-virtualenv”, and fail.

I appreciate the efficiency improvement in 1.9.2, but it changed the yum module’s behaviour in a major way, and it wasn’t even documented in the change log! I opened a bug report about this, but I don’t know how they’re going to resolve it.

https://github.com/ansible/ansible/issues/11526

In my own playbooks, I have worked around this by moving the installation of “epel-release” to an earlier task.

In the mean time, if you are using the yum module, beware when updating to 1.9.2!

Anand

<nod> Yeah, sorry for the compat change in a stable release. None of
us saw this potential corner case. We've decided that we're going to
keep this because it is a bugfix, not just an optimization.
Previously, if you were installing a package had a circular dependency
with a package specified via a filename or URL there was no way to get
it installed because the yum module would always try to install as two
separate transactions. The new behaviour of installing as one
transaction makes this work. It's also inline with what the yum
command line would do if given multiple packages.

I'm adding notes to the yum module documentation and the ChangeLog
about this change in behaviour.

-Toshio