Host vars, group vars, Inventory vars?

61 views
Skip to first unread message

Matt Hughes

unread,
Oct 3, 2014, 1:49:33 PM10/3/14
to ansible...@googlegroups.com
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.

Serge van Ginderachter

unread,
Oct 3, 2014, 1:51:47 PM10/3/14
to ansible...@googlegroups.com
​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.​

Jesse Szwedko

unread,
Oct 3, 2014, 3:19:02 PM10/3/14
to ansible...@googlegroups.com
Agreed, I'd use `group_vars/all`.

Matt Hughes

unread,
Oct 3, 2014, 4:10:15 PM10/3/14
to ansible...@googlegroups.com, Serge van Ginderachter

Thanks.

[all:vars] works great.




On October 3, 2014 at 1:51:47 PM, Serge van Ginderachter (se...@vanginderachter.be) wrote:


Reply all
Reply to author
Forward
0 new messages