### 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
if not repoq:
            pkgs = []
            updates = []
            try:
                pkgs = self.yum_base.returnPackagesByDep(pkgspec) + \
                    self.yum_base.returnInstalledPackagesByDep(pkgspec)
                if not pkgs:
                    e, m, _ = self.yum_base.pkgSack.matchPackageNames([pkgspec])
                    pkgs = e + m
                updates = self.yum_base.doPackageLists(pkgnarrow='updates').updates
            except Exception as e:
                self.module.fail_json(msg="Failure talking to yum: %s" % to_native(e))
            retpkgs = (pkg for pkg in pkgs if pkg in updates)
            return set(self.po_to_envra(p) for p in retpkgs)
        else:
            myrepoq = list(repoq)
            r_cmd = ['--disablerepo', ','.join(self.disablerepo)]
            myrepoq.extend(r_cmd)
            r_cmd = ['--enablerepo', ','.join(self.enablerepo)]
            myrepoq.extend(r_cmd)
            if self.releasever:
                myrepoq.extend('--releasever=%s' % self.releasever)
            cmd = myrepoq + ["--pkgnarrow=updates", "--qf", qf, pkgspec]
            rc, out, err = self.module.run_command(cmd)
            if rc == 0:
                return set(p for p in out.split('\n') if p.strip())
            else:
                self.module.fail_json(msg='Error from repoquery: %s: %s' % (cmd, err))
        return set()
    def what_provides(self, repoq, req_spec, qf=def_qf):