ansible/ansible-modules-extras — pull request #128 by robinro (2014-12-04 10:31:26+00:00)
Title: Patch multiple versions rpm zypper

Fix bug in ansible get_package_state and get_current_version that breaks when there are multiple versions of a package installed and there is a list of packages to install.
The previous implementation used 'zip' to match requested names to installed names which fails, because rpm outputs multiple lines per package when there are multiple versions.

Testcase: Install opensuse, install multiple kernel versions (happens by update)
Before patch a playbook like the following fails:
zypper: state=present for name={{item}}
with_items:
- kernel-desktop
- git

After the patch ansible performs as expected and makes sure both packages are present.
Also the last version number is used for further update information in this version (before if only one package name was given (to not trigger the bug) the oldest version number was used instead of the current).