##### [SUMMARY]
The following playbook have no failed tasks (only rescued), but the exit code of "ansible-playbook" is 2. Also AWX marks this job as failed

[issue-failed.zip](https://github.com/ansible/ansible/files/5084148/issue-failed.zip)



##### ISSUE TYPE
- Bug Report

##### COMPONENT NAME
ansible-playbook

##### ANSIBLE VERSION
<!--- Paste verbatim output from "ansible --version" between quotes -->
```paste below
ansible-playbook 2.9.11
  config file = /Users/xxx/git/vault/awx-scripts/ansible.cfg
  configured module search path = ['/Users/xxx/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/Cellar/ansible/2.9.11/libexec/lib/python3.8/site-packages/ansible
  executable location = /usr/local/bin/ansible-playbook
  python version = 3.8.5 (default, Jul 21 2020, 10:48:26) [Clang 11.0.3 (clang-1103.0.32.62)]
```

Also tested with the latest AWX version (14.0.0)

##### CONFIGURATION
<!--- Paste verbatim output from "ansible-config dump --only-changed" between quotes -->
```paste below

```

##### OS / ENVIRONMENT
<!--- Provide all relevant information below, e.g. target OS versions, network device firmware, etc. -->
MacOS & AWX Docker image

##### STEPS TO REPRODUCE
<!--- Describe exactly how to reproduce the problem, using a minimal test-case -->
Download the playbook: [issue-failed.zip](https://github.com/ansible/ansible/files/5084148/issue-failed.zip)
Create an inventory with 2 hosts (in this example host1 + host2)
Open issue-failed/test/tasks/include2.yml and replace the hostname with the first hostname of your inventory (line 5)

Run the playbook:
```
ansible-playbook --inventory "host1,host2" test.yml
```

Summery of the playbook: Both host have 0 failed tasks:
```
PLAY RECAP ************************************************************************************************************************************************************************************
host1 : ok=4    changed=0    unreachable=0    failed=0    skipped=0    rescued=1    ignored=0
host2 : ok=4    changed=0    unreachable=0    failed=0    skipped=2    rescued=0    ignored=0
```

But the exit code is 2 (playbook failed):
```
echo $?
2
```

When you remove the "when" condition in issue-failed/test/tasks/include2.yml, then the playbook exists with exitcode "0" (the expected behavior)
self._play = play
        self._blocks = []
        self._variable_manager = variable_manager
        
        gather_subset = self._play.gather_subset
        gather_timeout = self._play.gather_timeout
        fact_path = self._play.fact_path
        setup_block = Block(play=self._play)
        
        
        setup_block.run_once = False
        setup_task = Task(block=setup_block)
        setup_task.action = 'gather_facts'
        setup_task.name = 'Gathering Facts'
        setup_task.args = {
            'gather_subset': gather_subset,
        }
        
        if not self._play.tags:
            setup_task.tags = ['always']
        if gather_timeout:
            setup_task.args['gather_timeout'] = gather_timeout
        if fact_path:
            setup_task.args['fact_path'] = fact_path
        setup_task.set_loader(self._play._loader)
        
        if self._play._included_conditional is not None:
            setup_task.when = self._play._included_conditional[:]
        setup_block.block = [setup_task]
        setup_block = setup_block.filter_tagged_tasks(all_vars)