### Summary

See #74962 (feel free to re-open that one and close this one as a duplicate).

### Issue Type

Bug Report

### Component Name

yum

### Ansible Version

```console
$ ansible --version
ansible [core 2.11.6]
  config file = None
  configured module search path = ['/home/username/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/username/.local/lib/python3.8/site-packages/ansible
  ansible collection location = /home/username/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/username/.local/bin/ansible
  python version = 3.8.10 (default, Sep 28 2021, 16:10:42) [GCC 9.3.0]
  jinja version = 2.11.3
  libyaml = True
```


### Configuration

```console
$ ansible-config dump --only-changed
[nothing]
```


### OS / Environment

RHEL 7.9

### Steps to Reproduce

As part of the playbook, there are some tasks that install repo's and download RPM's:
<!--- Paste example playbooks or commands between quotes below -->
```yaml (paste below)
- name: Register ansible Yum repository
  become: yes
  ansible.builtin.yum_repository:
    name: ansible-epel7
    description: Ansible Red Hat 7 EPEL
    baseurl: https://releases.ansible.com/ansible/rpm/release/epel-7-x86_64/
    gpgcheck: yes
    gpgkey: https://releases.ansible.com/keys/RPM-GPG-KEY-ansible-release.pub

- name: Download Ansible RPMs to local controller Ansible RPM repository
  include_tasks: yum-download.yml
  vars:
    rpm_name: ansible
```
and:
```yaml
- name: Register ansible-runner Yum repository
  become: yes
  ansible.builtin.yum_repository:
    name: ansible-runner
    description: Ansible target dependencies
    baseurl: https://releases.ansible.com/ansible-runner/rpm/epel-7-x86_64/
    gpgcheck: yes
    gpgkey: https://releases.ansible.com/keys/RPM-GPG-KEY-ansible-release.pub

- name: Download pexpect RPMs
  include_tasks: yum-download.yml
  vars:
    rpm_name: python2-pexpect
```
with `yum-download.yml` as:
```yaml
- name: 'Download {{ rpm_name }} RPMs using yum'
  become: yes
  ansible.builtin.yum:
    name: '{{ rpm_name }}'
    download_only: yes
    download_dir: '{{local_rpm_repo_folder}}'
  environment: '{{ env_http_proxy }}'
```

### Expected Results

When running this playbook against a Red Hat 7.9 VM on Azure, I would expect just the RPM's to be downloaded (with maybe some small caching by yum).

### Actual Results

When running this playbook against a Red Hat 7.9 VM on Azure, yum fills the entire `/var` with cached data. (In fact, because by default `/var` is 8G I had to extend it first; I end up with some 12G!)

Only after changing:
```yaml
    gpgcheck: yes
```
to:
```yaml
    gpgcheck: no
```
does this work as expected (no huge amounts of data in `/var`, RPM's downloaded).

### Code of Conduct

- [X] I agree to follow the Ansible Code of Conduct
package = new_package_path
                else:
                    package = spec
                
                envra = self.local_envra(package)
                if envra is None:
                    self.module.fail_json(msg="Failed to get envra information from RPM package: %s" % spec)
                installed_pkgs = self.is_installed(repoq, envra)
                if installed_pkgs:
                    res['results'].append('%s providing %s is already installed' % (installed_pkgs[0], package))
                    continue
                (name, ver, rel, epoch, arch) = splitFilename(envra)
                installed_pkgs = self.is_installed(repoq, name)
                
                if len(installed_pkgs) == 2:
                    (cur_name0, cur_ver0, cur_rel0, cur_epoch0, cur_arch0) = splitFilename(installed_pkgs[0])
                    (cur_name1, cur_ver1, cur_rel1, cur_epoch1, cur_arch1) = splitFilename(installed_pkgs[1])
                    cur_epoch0 = cur_epoch0 or '0'
                    cur_epoch1 = cur_epoch1 or '0'
                    compare = compareEVR((cur_epoch0, cur_ver0, cur_rel0), (cur_epoch1, cur_ver1, cur_rel1))
                    if compare == 0 and cur_arch0 != cur_arch1:
                        for installed_pkg in installed_pkgs:
                            if installed_pkg.endswith(arch):
                                installed_pkgs = [installed_pkg]
                if len(installed_pkgs) == 1:
                    installed_pkg = installed_pkgs[0]
                    (cur_name, cur_ver, cur_rel, cur_epoch, cur_arch) = splitFilename(installed_pkg)
                    cur_epoch = cur_epoch or '0'
                    compare = compareEVR((cur_epoch, cur_ver, cur_rel), (epoch, ver, rel))