### Summary

When trying to list a package with wildcard using the yum module for RHEL 7 managed node, yum is returning incorrect results. Even if the package is installed on the RHEL7 managed node, yum returns only `"yumstate": "available"` and not   `"yumstate": "installed"`.

The same scenario works as expected on RHEL 8 nodes with a wildcard.


### Issue Type

Bug Report

### Component Name

yum

### Ansible Version

```console
$ ansible --version
ansible 2.9.15
  config file = /root/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.6/site-packages/ansible
  executable location = /bin/ansible
  python version = 3.6.8 (default, Aug 18 2020, 08:33:21) [GCC 8.3.1 20191121 (Red Hat 8.3.1-5)]
```


### Configuration

```console
$ ansible-config dump --only-changed
DEFAULT_HOST_LIST(/root/ansible.cfg) = ['/root/.inventory']
```


### OS / Environment

- RHEL 8 
- RHEL 7

### Steps to Reproduce

<!--- Paste example playbooks or commands between quotes below -->

- If we use a wildcard on a package for RHEL 7 managed node, and if the package we are listing via yum is already installed on RHEL 7, the yum still does not return `"yumstate": "installed"`. It only returns the `"yumstate": "available"`

```
root@ip ~]# ansible rhel7 -i inventory -m yum -a "list=device-mapper*" > s.out
[root@ip ~]# cat s.out | grep installed
````

- If we use the same ansible adhoc command for RHEL 8 host, we get the correct expected result and it returns ``"yumstate": "installed"``

```
[root@ip ~]# ansible rhel8 -i inventory -m yum -a "list=device-mapper*" > s.out
[root@ip ~]# cat s.out | grep installed
            "yumstate": "installed"
            "yumstate": "installed"
```
- Without using a wildcard to the package, everything works as expected on RHEL 7 as well as on RHEL 8.

```
[root@ip~]# ansible rhel7 -i inventory -m yum -a "list=device-mapper" > s.out
[root@ip~]# cat s.out | grep installed
            "repo": "installed",
            "yumstate": "installed"
```

### Expected Results

When running the command mentioned in Steps to Reproduce on RHEL 7, it should return the `"yumstate": "installed"` along with `"yumstate": "available"`

### Actual Results

```console
yum module is not returning the `"yumstate": "installed"` even if the package is already installed on RHEL 7 managed node.
```


### Code of Conduct

- [X] I agree to follow the Ansible Code of Conduct
default: "no"
    type: bool
    version_added: "2.12"
notes:
  - When used with a `loop:` each package will be processed individually,
    it is much more efficient to pass the list directly to the `name` option.
  - In versions prior to 1.9.2 this module installed and removed each package
    given to the yum module separately. This caused problems when packages
    specified by filename or url had to be installed or removed together. In
    1.9.2 this was fixed so that packages are installed in one yum
    transaction. However, if one of the packages adds a new yum repository
    that the other packages come from (such as epel-release) then that package
    needs to be installed in a separate task. This mimics yum's command line
    behaviour.
  - 'Yum itself has two types of groups.  "Package groups" are specified in the
    rpm itself while "environment groups" are specified in a separate file
    (usually by the distribution).  Unfortunately, this division becomes
    apparent to ansible users because ansible needs to operate on the group
    of packages in a single transaction and yum requires groups to be specified
    in different ways when used in that way.  Package groups are specified as
    "@development-tools" and environment groups are "@^gnome-desktop-environment".
    Use the "yum group list hidden ids" command to see which category of group the group
    you want to install falls into.'
  - 'The yum module does not support clearing yum cache in an idempotent way, so it
    was decided not to implement it, the only method is to use command and call the yum
    command directly, namely "command: yum clean all"
    https://github.com/ansible/ansible/pull/31450#issuecomment-352889579'
# informational: requirements for nodes
requirements:
- yum