<!--- 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

Traceback with `debug var=vars` when `ANSIBLE_JINJA2_NATIVE` is `true`

##### ISSUE TYPE
- Bug Report

##### COMPONENT NAME

lib/ansible/vars/manager.py

##### ANSIBLE VERSION

```
ansible 2.9.1
  config file = None
  configured module search path = ['/home/vagrant/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/vagrant/venv-main/lib/python3.7/site-packages/ansible
  executable location = /home/vagrant/venv-main/bin/ansible
  python version = 3.7.3 (default, Apr  3 2019, 19:16:38) [GCC 8.0.1 20180414 (experimental) [trunk revision 259383]]
```

##### CONFIGURATION

No config changes.
```
$ ansible-config dump --only-changed
$ 
```

##### OS / ENVIRONMENT

Ubuntu 18.04.2 LTS 

- running playbook on localhost


##### STEPS TO REPRODUCE

Command: 
```
ANSIBLE_JINJA2_NATIVE=true ansible-playbook -i localhost, -c local bug-playbook.yml -vvv
````

Playbook `bug-playbook.yml`:
```yaml
- hosts: all
  gather_facts: no
  tasks:

    - name: show vars
      debug: var=vars
    - name: show hostvars
      debug: var=hostvars
```


##### EXPECTED RESULTS

`debug` task shows vars output normally like this:

```
TASK [show vars] ***************************************************************************************************************************************************************************************************************************
task path: /home/vagrant/devel/IT_Cloud/Projects/iac/tryout/bug-vars/bug-playbook.yml:5
ok: [localhost] => {
    "vars": {
        "ansible_check_mode": false,
...
```

##### ACTUAL RESULTS

Traceback from `debug var` on `vars` and `hostvars`:
```
$ ANSIBLE_JINJA2_NATIVE=true ansible-playbook -i localhost, -c local bug-playbook.yml -vvvv
ansible-playbook 2.9.1
  config file = None
  configured module search path = ['/home/vagrant/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/vagrant/venv-main/lib/python3.7/site-packages/ansible
  executable location = /home/vagrant/venv-main/bin/ansible-playbook
  python version = 3.7.3 (default, Apr  3 2019, 19:16:38) [GCC 8.0.1 20180414 (experimental) [trunk revision 259383]]
No config file found; using defaults
setting up inventory plugins
Set default localhost to localhost
Parsed localhost, inventory source with host_list plugin
Loading callback plugin default of type stdout, v2.0 from /home/vagrant/venv-main/lib/python3.7/site-packages/ansible/plugins/callback/default.py

PLAYBOOK: bug-playbook.yml *****************************************************************************************************************************************************************************************************************
Positional arguments: bug-playbook.yml
verbosity: 4
connection: local
timeout: 10
become_method: sudo
tags: ('all',)
inventory: ('localhost,',)
forks: 5
1 plays in bug-playbook.yml

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

TASK [show vars] ***************************************************************************************************************************************************************************************************************************
task path: /home/vagrant/devel/IT_Cloud/Projects/iac/tryout/bug-vars/bug-playbook.yml:5
[WARNING]: Failure using method (v2_runner_on_ok) in callback plugin (<ansible.plugins.callback.default.CallbackModule object at 0x7f88cf423cf8>): 'VariableManager' object has no attribute '_loader'

Callback Exception: 
  File "/home/vagrant/venv-main/lib/python3.7/site-packages/ansible/executor/task_queue_manager.py", line 323, in send_callback
    method(*new_args, **kwargs)
   File "/home/vagrant/venv-main/lib/python3.7/site-packages/ansible/plugins/callback/default.py", line 156, in v2_runner_on_ok
    msg += " => %s" % (self._dump_results(result._result),)
   File "/home/vagrant/venv-main/lib/python3.7/site-packages/ansible/plugins/callback/__init__.py", line 126, in _dump_results
    jsonified_results = json.dumps(abridged_result, cls=AnsibleJSONEncoder, indent=indent, ensure_ascii=False, sort_keys=sort_keys)
   File "/usr/lib/python3.7/json/__init__.py", line 238, in dumps
    **kw).encode(obj)
   File "/usr/lib/python3.7/json/encoder.py", line 201, in encode
    chunks = list(chunks)
   File "/usr/lib/python3.7/json/encoder.py", line 431, in _iterencode
    yield from _iterencode_dict(o, _current_indent_level)
   File "/usr/lib/python3.7/json/encoder.py", line 405, in _iterencode_dict
    yield from chunks
   File "/usr/lib/python3.7/json/encoder.py", line 405, in _iterencode_dict
    yield from chunks
   File "/usr/lib/python3.7/json/encoder.py", line 438, in _iterencode
    o = _default(o)
   File "/home/vagrant/venv-main/lib/python3.7/site-packages/ansible/module_utils/common/json.py", line 53, in default
    value = dict(o)
   File "/home/vagrant/venv-main/lib/python3.7/site-packages/ansible/vars/hostvars.py", line 83, in __getitem__
    data = self.raw_get(host_name)
   File "/home/vagrant/venv-main/lib/python3.7/site-packages/ansible/vars/hostvars.py", line 80, in raw_get
    return self._variable_manager.get_vars(host=host, include_hostvars=False)
   File "/home/vagrant/venv-main/lib/python3.7/site-packages/ansible/vars/manager.py", line 178, in get_vars
    _hosts_all=_hosts_all,
   File "/home/vagrant/venv-main/lib/python3.7/site-packages/ansible/vars/manager.py", line 443, in _get_magic_variables
    variables['playbook_dir'] = os.path.abspath(self._loader.get_basedir())


TASK [show hostvars] ***********************************************************************************************************************************************************************************************************************
task path: /home/vagrant/devel/IT_Cloud/Projects/iac/tryout/bug-vars/bug-playbook.yml:8
Callback Exception: 
  File "/home/vagrant/venv-main/lib/python3.7/site-packages/ansible/executor/task_queue_manager.py", line 323, in send_callback
    method(*new_args, **kwargs)
   File "/home/vagrant/venv-main/lib/python3.7/site-packages/ansible/plugins/callback/default.py", line 156, in v2_runner_on_ok
    msg += " => %s" % (self._dump_results(result._result),)
   File "/home/vagrant/venv-main/lib/python3.7/site-packages/ansible/plugins/callback/__init__.py", line 126, in _dump_results
    jsonified_results = json.dumps(abridged_result, cls=AnsibleJSONEncoder, indent=indent, ensure_ascii=False, sort_keys=sort_keys)
   File "/usr/lib/python3.7/json/__init__.py", line 238, in dumps
    **kw).encode(obj)
   File "/usr/lib/python3.7/json/encoder.py", line 201, in encode
    chunks = list(chunks)
   File "/usr/lib/python3.7/json/encoder.py", line 431, in _iterencode
    yield from _iterencode_dict(o, _current_indent_level)
   File "/usr/lib/python3.7/json/encoder.py", line 405, in _iterencode_dict
    yield from chunks
   File "/usr/lib/python3.7/json/encoder.py", line 438, in _iterencode
    o = _default(o)
   File "/home/vagrant/venv-main/lib/python3.7/site-packages/ansible/module_utils/common/json.py", line 53, in default
    value = dict(o)
   File "/home/vagrant/venv-main/lib/python3.7/site-packages/ansible/vars/hostvars.py", line 83, in __getitem__
    data = self.raw_get(host_name)
   File "/home/vagrant/venv-main/lib/python3.7/site-packages/ansible/vars/hostvars.py", line 80, in raw_get
    return self._variable_manager.get_vars(host=host, include_hostvars=False)
   File "/home/vagrant/venv-main/lib/python3.7/site-packages/ansible/vars/manager.py", line 178, in get_vars
    _hosts_all=_hosts_all,
   File "/home/vagrant/venv-main/lib/python3.7/site-packages/ansible/vars/manager.py", line 443, in _get_magic_variables
    variables['playbook_dir'] = os.path.abspath(self._loader.get_basedir())

META: ran handlers
META: ran handlers

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

Running without the jinja2_native=true option does not have this problem (Normal output omitted).
```
$ ANSIBLE_JINJA2_NATIVE=false ansible-playbook -i localhost, -c local bug-playbook.yml -vvv
```
Workarounds:

- best option: set jinja2_native to false
- if you don't need jinja2_native for some playbooks, downgrade jinja2 to 2.9.6

Have tested this with 2.10.0 to 2.10.3, which all show this issue.

Related
---
#64745 looks similar but isn't the same, as the repro is different, and PR from @mkrizek  with fix is included in 2.9.1.  

- includes [this comment](https://github.com/ansible/ansible/issues/64745#issuecomment-553169757) with some related issues.



'''
        Clears the facts for a host
        '''
        self._fact_cache.pop(hostname, None)
    def set_host_facts(self, host, facts):
        '''
        Sets or updates the given facts for a host in the fact cache.
        '''
        if not isinstance(facts, Mapping):
            raise AnsibleAssertionError("the type of 'facts' to set for host_facts should be a Mapping but is a %s" % type(facts))
        try:
            host_cache = self._fact_cache[host]
        except KeyError:
            
            host_cache = facts
        else:
            if not isinstance(host_cache, MutableMapping):
                raise TypeError('The object retrieved for {0} must be a MutableMapping but was'
                                ' a {1}'.format(host, type(host_cache)))
            
            host_cache.update(facts)
        
        self._fact_cache[host] = host_cache
    def set_nonpersistent_facts(self, host, facts):