Ansible: Global scope variables file ?

Created on 29 Nov 2013  ·  3Comments  ·  Source: ansible/ansible

Hi,

After some googling and asking on IRC, there doesn't seem to be a global defaults variable file where you can set things like accelerate and gather_facts.

group_vars/all doesn't seem to work for variables at this level.

This means that for a big playbook with many plays you have to explicitly set them for each play, this is probably suboptimal ?

Most helpful comment

Hi Michael,

This is actually a feature (or at least documentation update) request, not a support one.
The question seems recurrent and the answer given is usually "group_vars/all", but this doesn't work for all scopes and certainly not for the variables I mentioned.
[all:vars] in the inventory looks like the next best answer, but when you have a few different inventory files you don't really want to be duplicating these values in all of them.

So, I feel that something similar to defaults/ in roles, at the playbook level, is missing.

All 3 comments

Hi,

(A) These are set on a play by play basis.

(B) In the future, please don't use github as a support forum. Stop by ansible-project on googlegroups instead.

Thanks!

Hi Michael,

This is actually a feature (or at least documentation update) request, not a support one.
The question seems recurrent and the answer given is usually "group_vars/all", but this doesn't work for all scopes and certainly not for the variables I mentioned.
[all:vars] in the inventory looks like the next best answer, but when you have a few different inventory files you don't really want to be duplicating these values in all of them.

So, I feel that something similar to defaults/ in roles, at the playbook level, is missing.

+1, can't find a place to define global defaults

Was this page helpful?
0 / 5 - 0 ratings