yum: fix yumstate when wildcards are used in list arg (#75545)

Fixes #74557

* map is not available on centos 6's jinja...
pull/75559/head
Martin Krizek 3 years ago committed by GitHub
parent 3ca50a2200
commit 2ba9e35d09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,2 @@
bugfixes:
- yum - fix ``yumstate`` return value when wildcards are used in the ``list`` argument (https://github.com/ansible/ansible/issues/74557)

@ -599,6 +599,8 @@ class YumModule(YumDnf):
rpmbin = self.module.get_bin_path('rpm', required=True)
cmd = [rpmbin, '-q', '--qf', qf, pkgspec]
if '*' in pkgspec:
cmd.append('-a')
if self.installroot != '/':
cmd.extend(['--root', self.installroot])
# rpm localizes messages and we're screen scraping so make sure we use

@ -703,3 +703,27 @@
yum:
name: dinginessentail,dinginessentail-olive,landsidescalping
state: absent
- block:
- yum:
name: dinginessentail
state: present
- yum:
list: dinginessentail*
register: list_out
- set_fact:
passed: true
loop: "{{ list_out.results }}"
when: item.yumstate == 'installed'
- name: Test that there is yumstate=installed in the result
assert:
that:
- passed is defined
always:
- name: Clean up
yum:
name: dinginessentail
state: absent

Loading…
Cancel
Save