mirror of
https://github.com/ansible/ansible.git
synced 2026-08-03 08:03:05 +02:00
yum: fix yumstate when wildcards are used in list arg (#75545)
Fixes #74557 * map is not available on centos 6's jinja...
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user