### Summary

When I define `failed_when:` condition in the task using `add_host`, it caused an error that the variable was not found.


### Issue Type

Bug Report

### Component Name

task

### Ansible Version

```console
$ ansible --version
ansible [core 2.11.2] 
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/var/lib/awx/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.8/site-packages/ansible
  ansible collection location = /var/lib/awx/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.8.6 (default, Jan 22 2021, 11:41:28) [GCC 8.4.1 20200928 (Red Hat 8.4.1-1)]
  jinja version = 2.10.3
  libyaml = True
```


### Configuration

```console
$ ansible-config dump --only-changed
$

(nothing)
```


### OS / Environment

$ cat /etc/redhat-release 
Red Hat Enterprise Linux release 8.4 (Ootpa)


### Steps to Reproduce

### pattern 1:  using `add_host` module 

```
---
- hosts: localhost
  gather_facts: false
  vars:
    test: 1
  tasks:
     - add_host:
         name: "myhost"
         groups: "mygroup"
         ansible_host: "host46"
         ansible_ssh_host: "192.168.100.100"
       failed_when: test == 2
```

When I ran the above playbook, it failed with error as below even the variable 'test' was defined in the play.

```
$ ansible-playbook -i localhost, conditional.yml 

PLAY [localhost] *********************************************************************************************************************************************************************************

TASK [add_host] **********************************************************************************************************************************************************************************
ERROR! The conditional check 'test == 2' failed. The error was: error while evaluating conditional (test == 2): 'test' is undefined
```

If I passed the variable as an extra_vars and specified to be true, it worked as expected.

```
$ ansible-playbook -i localhost, conditional.yml -e "{test: 2}"

PLAY [localhost] *********************************************************************************************************************************************************************************

TASK [add_host] **********************************************************************************************************************************************************************************
fatal: [localhost]: FAILED! => {"add_host": {"groups": ["mygroup"], "host_name": "myhost", "host_vars": {"ansible_host": "host46", "ansible_ssh_host": "192.168.100.100"}}, "changed": false, "failed_when_result": true}

NO MORE HOSTS LEFT *******************************************************************************************************************************************************************************

PLAY RECAP ***************************************************************************************************************************************************************************************
localhost                  : ok=0    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0   
```

On the other hand when "{test: 1}", it failed.

```
$ ansible-playbook -i localhost, conditional.yml -e "{test: 1}"

PLAY [localhost] *********************************************************************************************************************************************************************************

TASK [add_host] **********************************************************************************************************************************************************************************
ERROR! The conditional check 'test == 2' failed. The error was: error while evaluating conditional (test == 2): 'test' is undefined
```

### pattern 2: using `debug` module, it worked as desired

```
---
- hosts: localhost
  gather_facts: false
  vars:
    test: 1
  tasks:
     - debug:
         msg: "debug message"
       failed_when: test == 2
```

It works.

```
$ ansible-playbook -i localhost, debug.yml 

PLAY [localhost] *********************************************************************************************************************************************************************************

TASK [debug] *************************************************************************************************************************************************************************************
ok: [localhost] => {
    "msg": "debug message"
}

PLAY RECAP ***************************************************************************************************************************************************************************************
localhost                  : ok=1    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
```

When passed `2`, it failed as expected.

```
$ ansible-playbook -i localhost, debug.yml -e "{test: 2}"

PLAY [localhost] *********************************************************************************************************************************************************************************

TASK [debug] *************************************************************************************************************************************************************************************
fatal: [localhost]: FAILED! => {
    "msg": "debug message"
}

PLAY RECAP ***************************************************************************************************************************************************************************************
localhost                  : ok=0    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0   
```




### Expected Results

The `pattern 1` should work as the `pattern 2` from the point of view of handling the conditional.


### Actual Results

```console
(already pasted above)
```


### Code of Conduct

- [X] I agree to follow the Ansible Code of Conduct
if self._task.action in C._ACTION_ALL_INCLUDE_TASKS:
            include_args = self._task.args.copy()
            include_file = include_args.pop('_raw_params', None)
            if not include_file:
                return dict(failed=True, msg="No include file was specified to the include")
            include_file = templar.template(include_file)
            return dict(include=include_file, include_args=include_args)
        
        elif self._task.action in C._ACTION_INCLUDE_ROLE:
            include_args = self._task.args.copy()
            return dict(include_args=include_args)
        
        try:
            self._task.post_validate(templar=templar)
        except AnsibleError:
            raise
        except Exception:
            return dict(changed=False, failed=True, _ansible_no_log=self._play_context.no_log, exception=to_text(traceback.format_exc()))
        if '_variable_params' in self._task.args:
            variable_params = self._task.args.pop('_variable_params')
            if isinstance(variable_params, dict):
                if C.INJECT_FACTS_AS_VARS:
                    display.warning("Using a variable for a task's 'args' is unsafe in some situations "
                                    "(see https://docs.ansible.com/ansible/devel/reference_appendices/faq.html#argsplat-unsafe)")
                variable_params.update(self._task.args)
                self._task.args = variable_params
        if self._task.delegate_to:
            
            cvars = variables.get('ansible_delegated_vars', {}).get(self._task.delegate_to, {})
            orig_vars = templar.available_variables