##### [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)
state.tasks_child_state = None
                            state.rescue_child_state = None
                            state.always_child_state = None
                            state.did_rescue = False
                            
                            
                            if block._eor and host.name in block._role._had_task_run and not in_child and not peek:
                                block._role._completed[host.name] = True
                    else:
                        task = block.always[state.cur_always_task]
                        if isinstance(task, Block):
                            state.always_child_state = HostState(blocks=[task])
                            state.always_child_state.run_state = self.ITERATING_TASKS
                            task = None
                        state.cur_always_task += 1
            elif state.run_state == self.ITERATING_COMPLETE:
                return (state, None)
            
            if task:
                break
        return (state, task)
    def _set_failed_state(self, state):
        if state.run_state == self.ITERATING_SETUP:
            state.fail_state |= self.FAILED_SETUP
            state.run_state = self.ITERATING_COMPLETE
        elif state.run_state == self.ITERATING_TASKS:
            if state.tasks_child_state is not None:
                state.tasks_child_state = self._set_failed_state(state.tasks_child_state)
            else:
                state.fail_state |= self.FAILED_TASKS