##### SUMMARY
When ```include_vars``` is used in a role after a ```group_by```, complex variables fail to load whereas simple ones can be loaded.
This issue happens:

- only with 2.9.10
- not with previous ansible releases
- on Debian bullseye
- on Ubuntu 20.04
- ...

##### ISSUE TYPE
- Bug report

##### COMPONENT NAME
include_vars

##### ANSIBLE VERSION
```
ansible 2.9.10
  config file = /etc/ansible/ansible.cfg
  ansible python module location = /usr/local/lib/python3.8/dist-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 3.8.4rc1 (default, Jul  1 2020, 15:31:45) [GCC 9.3.0]
```

##### CONFIGURATION
```
ANSIBLE_PIPELINING(/etc/ansible/ansible.cfg) = True
CACHE_PLUGIN(/etc/ansible/ansible.cfg) = redis
CACHE_PLUGIN_TIMEOUT(/etc/ansible/ansible.cfg) = 3600
DEFAULT_EXECUTABLE(/etc/ansible/ansible.cfg) = /bin/bash
DEFAULT_FORKS(/etc/ansible/ansible.cfg) = 1000
DEFAULT_GATHERING(/etc/ansible/ansible.cfg) = explicit
DEFAULT_GATHER_TIMEOUT(/etc/ansible/ansible.cfg) = 30
DEFAULT_HASH_BEHAVIOUR(/etc/ansible/ansible.cfg) = merge
DEFAULT_HOST_LIST(/etc/ansible/ansible.cfg) = ['/etc/ansible/hosts']
DEFAULT_LOG_PATH(/etc/ansible/ansible.cfg) = /var/log/ansible.log
DEFAULT_PRIVATE_ROLE_VARS(/etc/ansible/ansible.cfg) = False
DEFAULT_TIMEOUT(/etc/ansible/ansible.cfg) = 180
DEFAULT_TRANSPORT(/etc/ansible/ansible.cfg) = ssh
ENABLE_TASK_DEBUGGER(/etc/ansible/ansible.cfg) = True
INTERPRETER_PYTHON(/etc/ansible/ansible.cfg) = /usr/bin/python3
PERSISTENT_COMMAND_TIMEOUT(/etc/ansible/ansible.cfg) = 3599
PERSISTENT_CONNECT_RETRY_TIMEOUT(/etc/ansible/ansible.cfg) = 200
PERSISTENT_CONNECT_TIMEOUT(/etc/ansible/ansible.cfg) = 3600
RETRY_FILES_ENABLED(/etc/ansible/ansible.cfg) = False
SHOW_CUSTOM_STATS(/etc/ansible/ansible.cfg) = True
```

##### OS / ENVIRONMENT
```
controller host: Debian bullseye
```

##### STEPS TO REPRODUCE
```playbook: include_vars issue.yml```
```
---
- name: Classifying all hosts
  hosts: all
  gather_facts: False
  tasks:
        - set_fact:
                os_family: os
        - set_fact:
                os_version: version
                
        - name: Classifying all hosts depending on their OS & release
          include_role:
                name: os_classify_issue
```
```roles/os_classify_issue/tasks/main.yml```
```
---
- name: Classifying the network host depending on its OS & release & loading the corresponding group variables
  group_by:
        key: "{{ os_family }}_{{ os_version }}"

- name: Including ansible connection variables
  block:
        - include_vars: "{{ role_path }}/vars/all/ssh/ansible_connections.with.private_key_file.yml"
          when: connections.ssh.private_key_file is defined

        - include_vars: "{{ role_path }}/vars/all/ssh/ansible_connections.wo.private_key_file.yml"
          when: connections.ssh.private_key_file is not defined

- debug:
        msg:
                - "ansible_network_os: {{ ansible_network_os }}"
                - "connections.ssh.become_method: {{ connections.ssh.become_method }}"
                - "ansible_become_method: {{ ansible_become_method }}"
```
```group_vars/os_version/connections.yml```
```
---
ansible_network_os: ios

connections:
        ssh:
          become: yes
          become_method: 'enable'
          private_key_file: "~/.ssh/id_rsa_4096"
```
```roles/os_classify_issue/vars/all/ssh/ansible_connections.with.private_key_file.yml```
```
---
ansible_become: "{{ connections.ssh.become }}"
ansible_become_method: "{{ connections.ssh.become_method }}"
```
##### ACTUAL RESULTS with ansible 2.9.9: No issue
```
PLAYBOOK: include_vars issue.yml *****************************************************************************************************************************
Positional arguments: issues/include_vars issue.yml
verbosity: 4
connection: ssh
timeout: 180
become_method: sudo
tags: ('all',)
inventory: ('hosts',)
subset: localhost
forks: 1000
1 plays in issues/include_vars issue.yml

PLAY [Classifying all hosts] *********************************************************************************************************************************
META: ran handlers

TASK [set_fact] **********************************************************************************************************************************************
task path: issues/include_vars issue.yml:6
ok: [localhost] => {
    "ansible_facts": {
        "os_family": "os"
    },
    "changed": false
}

TASK [set_fact] **********************************************************************************************************************************************
task path: issues/include_vars issue.yml:8
ok: [localhost] => {
    "ansible_facts": {
        "os_version": "version"
    },
    "changed": false
}

TASK [Classifying all hosts depending on their OS & release] *************************************************************************************************
task path: issues/include_vars issue.yml:11

TASK [os_classify_issue : Classifying the network host depending on its OS & release & loading the corresponding group variables] ****************************
task path: os_classify_issue/tasks/main.yml:2
ok: [localhost] => {
    "add_group": "os_version",
    "changed": false,
    "parent_groups": [
        "all"
    ]
}

TASK [os_classify_issue : include_vars] **********************************************************************************************************************
task path: os_classify_issue/tasks/main.yml:8
ok: [localhost] => {
    "ansible_facts": {
        "ansible_become": "{{ connections.ssh.become }}",
        "ansible_become_method": "{{ connections.ssh.become_method }}"
    },
    "ansible_included_var_files": [
        "os_classify_issue/vars/all/ssh/ansible_connections.with.private_key_file.yml"
    ],
    "changed": false
}

TASK [os_classify_issue : include_vars] **********************************************************************************************************************
task path: os_classify_issue/tasks/main.yml:11
skipping: [localhost] => {
    "changed": false,
    "skip_reason": "Conditional result was False"
}

TASK [os_classify_issue : debug] *****************************************************************************************************************************
task path: os_classify_issue/tasks/main.yml:14
ok: [localhost] => {
    "msg": [
        "ansible_network_os: ios",
        "connections.ssh.become_method: enable",
        "ansible_become_method: enable"
    ]
}
META: ran handlers
META: ran handlers

PLAY RECAP ***************************************************************************************************************************************************
localhost                  : ok=5    changed=0    unreachable=0    failed=0    skipped=1    rescued=0    ignored=0   
```
##### ACTUAL RESULTS with ansible 2.9.10: issue
**The included hash is not interpreted correctly**:
"Invalid become method specified, could not find matching plugin: '{{ connections.ssh.become_method }}'
```
# pip3 uninstall ansible
Found existing installation: ansible 2.9.9
Uninstalling ansible-2.9.9:
  Would remove:
    /usr/local/bin/ansible
    /usr/local/bin/ansible-config
    /usr/local/bin/ansible-connection
    /usr/local/bin/ansible-console
    /usr/local/bin/ansible-doc
    /usr/local/bin/ansible-galaxy
    /usr/local/bin/ansible-inventory
    /usr/local/bin/ansible-playbook
    /usr/local/bin/ansible-pull
    /usr/local/bin/ansible-test
    /usr/local/bin/ansible-vault
    /usr/local/lib/python3.8/dist-packages/ansible-2.9.9.dist-info/*
    /usr/local/lib/python3.8/dist-packages/ansible/*
    /usr/local/lib/python3.8/dist-packages/ansible_test/*
Proceed (y/n)? y
  Successfully uninstalled ansible-2.9.9
# pip3 install ansible==2.9.10
Collecting ansible==2.9.10
  Downloading ansible-2.9.10.tar.gz (14.2 MB)
     |████████████████████████████████| 14.2 MB 4.6 MB/s 
Requirement already satisfied: jinja2 in /usr/local/lib/python3.8/dist-packages (from ansible==2.9.10) (2.11.2)
Requirement already satisfied: PyYAML in /usr/local/lib/python3.8/dist-packages (from ansible==2.9.10) (5.3.1)
Requirement already satisfied: cryptography in /usr/local/lib/python3.8/dist-packages (from ansible==2.9.10) (2.9.2)
Requirement already satisfied: MarkupSafe>=0.23 in /usr/local/lib/python3.8/dist-packages (from jinja2->ansible==2.9.10) (1.1.1)
Requirement already satisfied: six>=1.4.1 in /usr/local/lib/python3.8/dist-packages (from cryptography->ansible==2.9.10) (1.15.0)
Requirement already satisfied: cffi!=1.11.3,>=1.8 in /usr/local/lib/python3.8/dist-packages (from cryptography->ansible==2.9.10) (1.14.0)
Requirement already satisfied: pycparser in /usr/local/lib/python3.8/dist-packages (from cffi!=1.11.3,>=1.8->cryptography->ansible==2.9.10) (2.20)
Building wheels for collected packages: ansible
  Building wheel for ansible (setup.py) ... done
  Created wheel for ansible: filename=ansible-2.9.10-py3-none-any.whl size=16174944 sha256=d99a55988aebfdb16f3dc2ba342b4d9131f627bd080519c039ae565b8b87aaab
  Stored in directory: /root/.cache/pip/wheels/f0/02/9e/e40841e0c3ab60142092320d6cbe45c699a965e6224dbd1258
Successfully built ansible
Installing collected packages: ansible
Successfully installed ansible-2.9.10
```
```
PLAYBOOK: include_vars issue.yml *****************************************************************************************************************************
Positional arguments: issues/include_vars issue.yml
verbosity: 4
connection: ssh
timeout: 180
become_method: sudo
tags: ('all',)
inventory: ('hosts',)
subset: localhost
forks: 1000
1 plays in issues/include_vars issue.yml

PLAY [Classifying all hosts] *********************************************************************************************************************************
META: ran handlers

TASK [set_fact] **********************************************************************************************************************************************
task path: issues/include_vars issue.yml:6
ok: [localhost] => {
    "ansible_facts": {
        "os_family": "os"
    },
    "changed": false
}

TASK [set_fact] **********************************************************************************************************************************************
task path: issues/include_vars issue.yml:8
ok: [localhost] => {
    "ansible_facts": {
        "os_version": "version"
    },
    "changed": false
}

TASK [Classifying all hosts depending on their OS & release] *************************************************************************************************
task path: issues/include_vars issue.yml:11

TASK [os_classify_issue : Classifying the network host depending on its OS & release & loading the corresponding group variables] ****************************
task path: os_classify_issue/tasks/main.yml:2
ok: [localhost] => {
    "add_group": "os_version",
    "changed": false,
    "parent_groups": [
        "all"
    ]
}

TASK [os_classify_issue : include_vars] **********************************************************************************************************************
task path: os_classify_issue/tasks/main.yml:8
ok: [localhost] => {
    "ansible_facts": {
        "ansible_become": "{{ connections.ssh.become }}",
        "ansible_become_method": "{{ connections.ssh.become_method }}"
    },
    "ansible_included_var_files": [
        "os_classify_issue/vars/all/ssh/ansible_connections.with.private_key_file.yml"
    ],
    "chan"Invalid become method specified, could not find matching plugin: '{{ connections.ssh.become_method }}'ged": false
}

TASK [os_classify_issue : include_vars] **********************************************************************************************************************
task path: os_classify_issue/tasks/main.yml:11
skipping: [localhost] => {
    "changed": false,
    "skip_reason": "Conditional result was False"
}

TASK [os_classify_issue : debug] *****************************************************************************************************************************
task path: os_classify_issue/tasks/main.yml:14
fatal: [localhost]: FAILED! => {
    "msg": "Invalid become method specified, could not find matching plugin: '{{ connections.ssh.become_method }}'. Use `ansible-doc -t become -l` to list available plugins."
}
```

'''
        Runs the task with the loop items specified and collates the result
        into an array named 'results' which is inserted into the final result
        along with the item for which the loop ran.
        '''
        results = []
        
        
        
        task_vars = self._job_vars
        loop_var = 'item'
        index_var = None
        label = None
        loop_pause = 0
        extended = False
        templar = Templar(loader=self._loader, shared_loader_obj=self._shared_loader_obj, variables=self._job_vars)
        
        if self._task.loop_control:
            loop_var = templar.template(self._task.loop_control.loop_var)
            index_var = templar.template(self._task.loop_control.index_var)
            loop_pause = templar.template(self._task.loop_control.pause)
            extended = templar.template(self._task.loop_control.extended)
            
            label = self._task.loop_control.label
        
        if label is None:
            label = '{{' + loop_var + '}}'
        if loop_var in task_vars:
            display.warning(u"The loop variable '%s' is already in use. "