# Where do extra-vars appear in internal dictionaries/objects?

**URL:** <https://forum.ansible.com/t/where-do-extra-vars-appear-in-internal-dictionaries-objects/19825>\
**Category:** Ansible Project\
**Created:** [November 21, 2015, 5:11pm UTC](https://forum.ansible.com/t/where-do-extra-vars-appear-in-internal-dictionaries-objects/19825 "2015-11-21T17:11:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Larry\_Fast](https://avatars.discourse-cdn.com/v4/letter/l/b3f665/32.png) [@Larry\_Fast](https://forum.ansible.com/u/Larry_Fast)\
**Post date:** [November 21, 2015, 5:11pm UTC](https://forum.ansible.com/t/where-do-extra-vars-appear-in-internal-dictionaries-objects/19825/1 "2015-11-21T17:11:06Z")

</div>

When debugging ansible I like to do a json dump of EVERYTHING. But I’m not seeing my extra-vars in my dump. Here’s the jinja template to dump all ansible’s internal variables. What can I add to see the extra-vars?

```auto
{
"hostvars": {
{% for key in groups["all"] %}
  "{{key}}": {{ hostvars[key] |to_nice_json }}
,
{% endfor %}

  "localhost": {{hostvars['localhost'] | to_nice_json}}
},
"vars": {{ vars | to_nice_json }}
,
"environment": {{ environment | to_nice_json }}
,
"group_names": {{ group_names | to_nice_json }}
,
"groups": {{ groups | to_nice_json }}
}

```

Example Playbook:

```auto
- hosts: localhost
  tasks:
    - shell: echo hello {{ xvar }}
      register: hello
- include: dump.pb # this is my JSON dump code

```

If I run this without defining xvar I get an error. The following command succeeds:

```auto
ansible-playbook -i hosts_cpci1 tmp.pb --extra-vars "xvar=world"

```

The JSON dump shows that xvar=world got through but xvar doesn’t show up in either the vars or localhost listing. Abridged JSON output below.

```auto
 "hostvars": { "localhost": { "hello": {
        "cmd": "echo hello world", } } }
"vars": {
    "always_run": false,
    "ansible_version": { "full": "1.9.2" },
    "delegate_to": "127.0.0.1",
    "playbook_dir": "/home/ansible/test",
}

```
