# Host vars, group vars, Inventory vars?

**URL:** <https://forum.ansible.com/t/host-vars-group-vars-inventory-vars/16422>\
**Category:** Ansible Project\
**Created:** [October 3, 2014, 5:49pm UTC](https://forum.ansible.com/t/host-vars-group-vars-inventory-vars/16422 "2014-10-03T17:49:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matt\_Hughes](https://avatars.discourse-cdn.com/v4/letter/m/f04885/32.png) [@Matt\_Hughes](https://forum.ansible.com/u/Matt_Hughes)\
**Post date:** [October 3, 2014, 5:49pm UTC](https://forum.ansible.com/t/host-vars-group-vars-inventory-vars/16422/1 "2014-10-03T17:49:33Z")

</div>

I know you can specify group ‘foo’ and then declare variables for everything with [foo:vars]. Is there any way to apply variables to _every_ host in the inventory? I was thinking:

[\*:vars] would work but it does not appear to.

---

<div class="post-metadata">

**Author:** ![Serge\_van\_Ginderacht](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@Serge\_van\_Ginderacht](https://forum.ansible.com/u/Serge_van_Ginderacht)\
**Post date:** [October 3, 2014, 5:51pm UTC](https://forum.ansible.com/t/host-vars-group-vars-inventory-vars/16422/2 "2014-10-03T17:51:24Z")

</div>

​That would be via the default 'all' group​:

[

> ​all​  
> :vars] would work but it does not appear to.

​though I would recommend you to not put variables in the ini file, and use  
the host/group\_vars construct.​

---

<div class="post-metadata">

**Author:** ![Jesse\_Szwedko1](https://avatars.discourse-cdn.com/v4/letter/j/a8b319/32.png) [@Jesse\_Szwedko1](https://forum.ansible.com/u/Jesse_Szwedko1)\
**Post date:** [October 3, 2014, 7:19pm UTC](https://forum.ansible.com/t/host-vars-group-vars-inventory-vars/16422/3 "2014-10-03T19:19:02Z")

</div>

Agreed, I’d use `group_vars/all`.

---

<div class="post-metadata">

**Author:** ![Matt\_Hughes](https://avatars.discourse-cdn.com/v4/letter/m/f04885/32.png) [@Matt\_Hughes](https://forum.ansible.com/u/Matt_Hughes)\
**Post date:** [October 3, 2014, 8:10pm UTC](https://forum.ansible.com/t/host-vars-group-vars-inventory-vars/16422/4 "2014-10-03T20:10:09Z")

</div>

Thanks.

[all:vars] works great.
