# Ansible 2.0 Beta 3 is available for testing

**URL:** <https://forum.ansible.com/t/ansible-2-0-beta-3-is-available-for-testing/19777>\
**Category:** Ansible Developer\
**Created:** [November 16, 2015, 8:03pm UTC](https://forum.ansible.com/t/ansible-2-0-beta-3-is-available-for-testing/19777 "2015-11-16T20:03:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michel\_Blanc](https://avatars.discourse-cdn.com/v4/letter/m/ba8739/32.png) [@Michel\_Blanc](https://forum.ansible.com/u/Michel_Blanc)\
**Post date:** [November 16, 2015, 8:03pm UTC](https://forum.ansible.com/t/ansible-2-0-beta-3-is-available-for-testing/19777/1 "2015-11-16T20:03:43Z")

</div>

Hi List/James,

> If you discover any errors related to this beta release, or if you see  
> regressions from playbooks which work on 1.9.x and prior, please open a  
> Github issue and be sure to mention which version you're testing.

Before opening an issue, just a probe here.

It seems that ansible 2.0 does not support multiple inventory files in  
the same directory, like it did before.  
I think it should work, since it is:

1- handy 🙂  
2- mentioned in the docs:  
&nbsp;&nbsp;&nbsp;"Not only is this inventory configurable, but you can also  
&nbsp;&nbsp;&nbsp;use multiple inventory files at the same time (explained below)"  
&nbsp;&nbsp;&nbsp;(note that, unless I missed it, it is not "explained below").

This being said, here is a small test setup:

$ grep elastic1 inventories/devel/\*  
inventories/devel/generated:elastic1 from\_generated="yes"  
inventories/devel/hosts:elastic1 from\_hosts="yes"

So here we have two inventory files (named `generated` and `hosts`). In  
each file, we define a variable for the host `elastic1` (respectively  
`from_generated` and `from_hosts`) and set is to the string "yes".

With 1.9.4, all is fine:

$ ansible --version  
ansible 1.9.4  
configured module search path = None  
$ ansible elastic1 -i inventories/devel/ -m debug -a  
'msg="{{from\_generated}} {{from\_hosts}}"'  
elastic1 | success \>\> {  
&nbsp;&nbsp;&nbsp;&nbsp;"msg": "yes yes"  
}

Now ansible 2.0b3:

$ ansible --version  
ansible 2.0.0 (detached HEAD 07b588f6c0) last updated 2015/11/16  
20:52:36 (GMT +200)  
$ ansible elastic1 -i inventories/devel/ -m debug -a  
'msg="{{from\_generated}} {{from\_hosts}}"'  
elastic1 | FAILED! =\> {  
&nbsp;&nbsp;&nbsp;&nbsp;"failed": true,  
&nbsp;&nbsp;&nbsp;&nbsp;"msg": "ERROR! 'from\_hosts' is undefined"  
}  
$ ansible elastic1 -i inventories/devel/ -m debug -a  
'msg="{{from\_generated}}"'  
elastic1 | SUCCESS =\> {  
&nbsp;&nbsp;&nbsp;&nbsp;"changed": false,  
&nbsp;&nbsp;&nbsp;&nbsp;"msg": "yes"  
}

If I rename `generated` to `zippy`:

$ mv inventories/devel/generated inventories/devel/zippy  
$ ansible elastic1 -i inventories/devel/ -m debug -a  
'msg="{{from\_generated}}"'  
elastic1 | FAILED! =\> {  
&nbsp;&nbsp;&nbsp;&nbsp;"failed": true,  
&nbsp;&nbsp;&nbsp;&nbsp;"msg": "ERROR! 'from\_generated' is undefined"  
}  
$ ansible elastic1 -i inventories/devel/ -m debug -a 'msg="{{from\_hosts}}"'  
elastic1 | SUCCESS =\> {  
&nbsp;&nbsp;&nbsp;&nbsp;"changed": false,  
&nbsp;&nbsp;&nbsp;&nbsp;"msg": "yes"  
}

So it seems Ansible now read inventory from the first file found (sorted  
alpha) and stops here.

Is this the intended behavior or should an issue be opened ?

Thanks,

M

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [November 16, 2015, 8:07pm UTC](https://forum.ansible.com/t/ansible-2-0-beta-3-is-available-for-testing/19777/2 "2015-11-16T20:07:51Z")

</div>

not intended at all

---

<div class="post-metadata">

**Author:** ![Tim\_Butler](https://avatars.discourse-cdn.com/v4/letter/t/4da419/32.png) [@Tim\_Butler](https://forum.ansible.com/u/Tim_Butler)\
**Post date:** [November 20, 2015, 6:10am UTC](https://forum.ansible.com/t/ansible-2-0-beta-3-is-available-for-testing/19777/3 "2015-11-20T06:10:01Z")

</div>

I finally created some crude unit tests ([https://github.com/itldo/ansible\_test\_var](https://github.com/itldo/ansible_test_var)) to demonstrate  
the inconsistent and seemingly random behavior  
I was experiencing with inventory host variables.  
The summary (if you can wade through it) is at

- [https://github.com/itldo/ansible\_test\_var](https://github.com/itldo/ansible_test_var)
- [https://github.com/itldo/ansible\_test\_var/blob/master/example\_results](https://github.com/itldo/ansible_test_var/blob/master/example_results)

I believe these are relevant to the following issues:

- [https://github.com/ansible/ansible/issues/13081](https://github.com/ansible/ansible/issues/13081)
- [https://github.com/ansible/ansible/issues/13187](https://github.com/ansible/ansible/issues/13187)

Most importantly I would like to see behavior defined for the same host  
mentioned explicitly in more than one inventory (if it is supported at all).

In particular, which of these should be true?

- Host variables defined in different inventories will be merged according to {{ some precedence rules }}.

- Host variables defined in different inventories will be merged with conflicts resulting in an {{ error , warning, undefined manner }}.

- Hosts may be mentioned in multiple inventories, but may have variables defined in at most one inventory

- Hosts must _not_ be mentioned explicitly in multiple inventories, however the groups they belong to may.

- Dynamic Groups may be children of Static Groups.  
Thanks.  
-tim
