Is there a list of all vars available in a template/playbook?

I’m fumbling about and I keep running into vars I didn’t know existed. For example, I just saw “group_names” in the hadoop iptables example (https://github.com/jkleint/ansible-hadoop/blob/master/templates/iptables).

I know I can make a template with {{ hostvarvs|pprint }} and see what hostvars I have. Then I found {{ groups|pprint }}. Now I just discovered {{ group_names }}What joy! What other top-level variables are there that I should know about?

And what about in playbooks? I can register variables and use them, I can use ${hostvars.blah.blah.blah} and I can use the setup module to find ansible_fact variables. Are there other vars available in playbooks by default? (not talking about vars I set in the playbook or vars_files)

I’d love a canonical list or a command that outputs a list or a nudge in the direction of what part of the code I should examine.

Thanks for any answers and thanks for Ansible!
-Dylan

As an aside, while poking around the docs I found this:

Also, in version 0.5 and later, Ansible playbook output is vastly upgraded if the cowsay package is installed. Try it!

Try it, I did. I am filled with conflicted emotions.

cowsay -T ‘||’ -e “/” “I vant to suck your miiiiilk”

cowsay -T '||' -e "\/" "I vant to suck your miiiiilk"

After installing `cowsay' you can disable it for use by Ansible
by setting ANSIBLE_NOCOWS=moo in your environment. (*ducks to avoid
flying cows*)

        -JP

I’ll add a ‘me too’ to this.

Just dump a sample template and this will give you a very good idea.

Like this in a basic template:

{ hostvars["yourhostname"] | to_yaml }