YAML inventory
ansible 2.2.0.0
config file =
configured module search path = Default w/o overrides
N/A
N/A
We should be able to define all vars in yaml inventory, just like we can do it in ini ones, such as:
[all:vars]
foo=bar
Given the following hosts.yml
all:
vars:
foo: bar
test:
hosts:
localhost:
and the following command:
ansible -i hosts.yml all -m debug -a var=foo
localhost | SUCCESS => {
"foo": "bar"
}
localhost | SUCCESS => {
"foo": "VARIABLE IS NOT DEFINED!"
}
fixed via #22418
you should be able to do this now:
all:
hosts:
host1
vars:
myvar: myval
children:
group1: ....
Most helpful comment
fixed via #22418
you should be able to do this now: