# magic variables

**URL:** <https://forum.ansible.com/t/magic-variables/12260>\
**Category:** Ansible Project\
**Created:** [January 29, 2013, 12:05am UTC](https://forum.ansible.com/t/magic-variables/12260 "2013-01-29T00:05:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yves\_Dorfsman](https://avatars.discourse-cdn.com/v4/letter/y/9de0a6/32.png) [@Yves\_Dorfsman](https://forum.ansible.com/u/Yves_Dorfsman)\
**Post date:** [January 29, 2013, 12:05am UTC](https://forum.ansible.com/t/magic-variables/12260/1 "2013-01-29T00:05:12Z")

</div>

Is there a comprehensive list of all the magic varialbes?

I've been using $inventory\_hostname a lot. Right I'm looking for the user name of the user running the playbook, etc... Every time I am about to register a variable from a command, I'm wondering if what I'm looking for isn't in a magic variable already.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [January 29, 2013, 2:24am UTC](https://forum.ansible.com/t/magic-variables/12260/2 "2013-01-29T02:24:06Z")

</div>

[https://groups.google.com/forum/?fromgroups=#!searchin/ansible-project/template\_/ansible-project/paudzD0SnlM/wWLfH49XoDQJ](https://groups.google.com/forum/?fromgroups=#!searchin/ansible-project/template_/ansible-project/paudzD0SnlM/wWLfH49XoDQJ)

Docs should be in better order shortly, if not already, as  
$inventory\_hostname is not really just a \*template\* variable and there  
is hostvars and such.

I'll make a note to make a better docs section.
