<!--- Verify first that your issue is not already reported on GitHub -->
<!--- Also test if the latest release and devel branch are affected too -->
<!--- Complete *all* sections as described, this form is processed automatically -->

##### SUMMARY
Running the playbook below returns "changed" though the Yum/DNF transaction failed.

##### ISSUE TYPE
- Bug Report

##### COMPONENT NAME
Yum

##### ANSIBLE VERSION
<!--- Paste verbatim output from "ansible --version" between quotes -->
```paste below
$ ansible --version
ansible 2.9.10.post0
  config file = None
  configured module search path = [u'/opt/ansible/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /opt/ansible/source/lib/ansible
  executable location = /opt/ansible/source/bin/ansible
  python version = 2.7.9 (default, Nov 18 2015, 13:07:23) [GCC 4.4.7 20120313 (Red Hat 4.4.7-16)]
```
The issue also occurs with the latest development build at the time of this posting.

##### CONFIGURATION
<!--- Paste verbatim output from "ansible-config dump --only-changed" between quotes -->
```paste below
$ ansible-config dump --only-changed
ANSIBLE_NOCOWS(/home/elliott.barrere-a/dv-ansible/ansible.cfg) = True
ANSIBLE_SSH_ARGS(/home/elliott.barrere-a/dv-ansible/ansible.cfg) = -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s -o ServerAliveInterval=10
CACHE_PLUGIN(/home/elliott.barrere-a/dv-ansible/ansible.cfg) = jsonfile
CACHE_PLUGIN_CONNECTION(/home/elliott.barrere-a/dv-ansible/ansible.cfg) = ./cache
CACHE_PLUGIN_TIMEOUT(/home/elliott.barrere-a/dv-ansible/ansible.cfg) = 86400
DEFAULT_FORKS(/home/elliott.barrere-a/dv-ansible/ansible.cfg) = 25
DEFAULT_GATHERING(/home/elliott.barrere-a/dv-ansible/ansible.cfg) = smart
DEFAULT_HOST_LIST(/home/elliott.barrere-a/dv-ansible/ansible.cfg) = [u'/home/elliott.barrere-a/dv-ansible/inventory/production']
DEFAULT_LOG_PATH(/home/elliott.barrere-a/dv-ansible/ansible.cfg) = /var/log/ansible.log
DEFAULT_MANAGED_STR(/home/elliott.barrere-a/dv-ansible/ansible.cfg) = Ansible managed from {host}
DEFAULT_MODULE_PATH(/home/elliott.barrere-a/dv-ansible/ansible.cfg) = [u'/home/elliott.barrere-a/dv-ansible/library']
DEFAULT_POLL_INTERVAL(/home/elliott.barrere-a/dv-ansible/ansible.cfg) = 7
DEFAULT_ROLES_PATH(/home/elliott.barrere-a/dv-ansible/ansible.cfg) = [u'/home/elliott.barrere-a/dv-ansible/roles']
DEFAULT_TIMEOUT(/home/elliott.barrere-a/dv-ansible/ansible.cfg) = 60
DEFAULT_VAULT_PASSWORD_FILE(/home/elliott.barrere-a/dv-ansible/ansible.cfg) = /home/elliott.barrere-a/dv-ansible/open_the_vault.sh
DISPLAY_SKIPPED_HOSTS(/home/elliott.barrere-a/dv-ansible/ansible.cfg) = False
HOST_KEY_CHECKING(/home/elliott.barrere-a/dv-ansible/ansible.cfg) = False
PERSISTENT_COMMAND_TIMEOUT(/home/elliott.barrere-a/dv-ansible/ansible.cfg) = 100
PERSISTENT_CONNECT_RETRY_TIMEOUT(/home/elliott.barrere-a/dv-ansible/ansible.cfg) = 100
PERSISTENT_CONNECT_TIMEOUT(/home/elliott.barrere-a/dv-ansible/ansible.cfg) = 100
RETRY_FILES_SAVE_PATH(/home/elliott.barrere-a/dv-ansible/ansible.cfg) = /home/elliott.barrere-a/.ansible-retry
```

##### OS / ENVIRONMENT
<!--- Provide all relevant information below, e.g. target OS versions, network device firmware, etc. -->
CentOS Linux release 8.2.2004 (Core) 

##### STEPS TO REPRODUCE
<!--- Describe exactly how to reproduce the problem, using a minimal test-case -->

<!--- Paste example playbooks or commands between quotes below -->
```yaml
- hosts: linux

  tasks:
    - name: install pbis
      yum: name='pbis-open-9.1.0-551'
      become: yes
```

The above returns no error, though the package is not installed due to a missing dependency found during script execution.

<!--- HINT: You can paste gist.github.com links for larger files -->

##### EXPECTED RESULTS
<!--- Describe what you expected to happen when running the steps above -->

The above should FAIL if the package is not installed

##### ACTUAL RESULTS
<!--- Describe what actually happened. If possible run with extra verbosity (-vvvv) -->
The module returns "changed" as if everything was okay.

<!--- Paste verbatim command output between quotes -->
```paste below

ansible-playbook playbooks/linux/test_pbis.yaml -l test -e 'ansible_user="{{linux_default_root_user}}" ansible_password="{{linux_default_root_password}}"'
[WARNING]: You are running the development version of Ansible. You should only run Ansible from "devel" if you are modifying the Ansible engine, or trying out features under development. This is a rapidly changing source
of code and can become unstable at any point.

PLAY [linux, vagrant_linux, test_web, centos_templates] ***********************************************************************************************************************************************************************

TASK [install pbis] ***********************************************************************************************************************************************************************************************************
changed: [den3jmisc02]

PLAY RECAP ********************************************************************************************************************************************************************************************************************
test                : ok=1    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
```
Testing if the package was truly installed:
```
$ ansible -m shell -e 'ansible_user="{{linux_default_root_user}}" ansible_password="{{linux_default_root_password}}"' -a 'rpm -qa pbis-open' test
[WARNING]: Consider using the yum, dnf or zypper module rather than running 'rpm'.  If you need to use command because yum, dnf or zypper is insufficient you can add 'warn: false' to this command task or set
'command_warnings=False' in ansible.cfg to get rid of this message.
test | CHANGED | rc=0 >>
```

Here is the command output when run locally on the host:

```
[root@test ~]# dnf install -y pbis-open-9.1.0-551
Last metadata expiration check: 0:04:21 ago on Tue 17 Nov 2020 02:05:58 PM MST.
Dependencies resolved.
===============================================================================================================================================================================================================================
 Package                                                Architecture                                        Version                                                   Repository                                          Size
===============================================================================================================================================================================================================================
Installing:
 pbis-open                                              x86_64                                              9.1.0-551                                                 pbiso                                               14 M

Transaction Summary
===============================================================================================================================================================================================================================
Install  1 Package

Total size: 14 M
Installed size: 40 M
Downloading Packages:
[SKIPPED] pbis-open-9.1.0-551.x86_64.rpm: Already downloaded                                                                                                                                                                  
warning: /var/cache/dnf/pbiso-7802c5d179dc88d5/packages/pbis-open-9.1.0-551.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID c9ceecef: NOKEY
PBISO- local packages for x86_64                                                                                                                                                                11 kB/s | 1.4 kB     00:00    
Importing GPG key 0xC9CEECEF:
 Userid     : "BeyondTrust (PowerBroker Identity Services Open Project) <openproject@beyondtrust.com>"
 Fingerprint: BE7F F72A 6B7C 8A9F AE06 1F4F 2E52 CD89 C9CE ECEF
 From       : https://repo.pbis.beyondtrust.com/yum/RPM-GPG-KEY-pbis-1024
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                                                                       1/1 
  Running scriptlet: pbis-open-9.1.0-551.x86_64                                                                                                                                                                            1/1 
BeyondTrust AD Bridge Open requires library libnsl.so.1; please install libnsl.so.1 before installing AD Bridge.

error: %prein(pbis-open-9.1.0-551.x86_64) scriptlet failed, exit status 1

Error in PREIN scriptlet in rpm package pbis-open
  Verifying        : pbis-open-9.1.0-551.x86_64                                                                                                                                                                            1/1 

Failed:
  pbis-open-9.1.0-551.x86_64                                                                                                                                                                                                   

Error: Transaction failed
[root@test ~]# echo $?
1
```

The command fails and the correct RC is set.
- If C(yes) it allows  erasing  of  installed  packages to resolve dependencies.
    required: false
    type: bool
    default: "no"
    version_added: "2.10"
  nobest:
    description:
      - Set best option to False, so that transactions are not limited to best candidates only.
    required: false
    type: bool
    default: "no"
    version_added: "2.11"
  cacheonly:
    description:
      - Tells dnf to run entirely from system cache; does not download or update metadata.
    type: bool
    default: "no"
    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.
  - Group removal doesn't work if the group was installed with Ansible because
    upstream dnf's API doesn't properly mark groups as installed, therefore upon
    removal the module is unable to detect that the group is installed
    (https://bugzilla.redhat.com/show_bug.cgi?id=1620324)
requirements:
  - "python >= 2.6"
  - python-dnf
  - for the autoremove option you need dnf >= 2.0.1"
author:
  - Igor Gnatenko (@ignatenkobrain) <i.gnatenko.brain@gmail.com>