### 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
""" The need of this entire if conditional has to be changed
                this function is the ensure function that is called
                in the main section.
                This conditional tends to disable/enable repo for
                install present latest action, same actually
                can be done for remove and absent action
                As solution I would advice to cal
                try: self.yum_base.repos.disableRepo(disablerepo)
                and
                try: self.yum_base.repos.enableRepo(enablerepo)
                right before any yum_cmd is actually called regardless
                of yum action.
                Please note that enable/disablerepo options are general
                options, this means that we can call those with any action
                option.  https://linux.die.net/man/8/yum
                This docstring will be removed together when issue: #21619
                will be solved.
                This has been triggered by: #19587
            """
            if self.update_cache:
                self.module.run_command(self.yum_basecmd + ['clean', 'expire-cache'])
            try:
                current_repos = self.yum_base.repos.repos.keys()
                if self.enablerepo:
                    try:
                        new_repos = self.yum_base.repos.repos.keys()
                        for i in new_repos:
                            if i not in current_repos:
                                rid = self.yum_base.repos.getRepo(i)
                                a = rid.repoXML.repoid