# Upgrading to Ansible 2 break EC2 inventory groups augmentation

**URL:** <https://forum.ansible.com/t/upgrading-to-ansible-2-break-ec2-inventory-groups-augmentation/21226>\
**Category:** Ansible Project\
**Created:** [April 21, 2016, 7:27am UTC](https://forum.ansible.com/t/upgrading-to-ansible-2-break-ec2-inventory-groups-augmentation/21226 "2016-04-21T07:27:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tzach\_Livyatan1](https://avatars.discourse-cdn.com/v4/letter/t/9fc29f/32.png) [@Tzach\_Livyatan1](https://forum.ansible.com/u/Tzach_Livyatan1)\
**Post date:** [April 21, 2016, 7:27am UTC](https://forum.ansible.com/t/upgrading-to-ansible-2-break-ec2-inventory-groups-augmentation/21226/1 "2016-04-21T07:27:54Z")

</div>

Hi  
I have a working play book in Ansible 1.9  
As part of it, I’m defining extra groups in file inventories/ec2/hosts, for example:

`

[us-west-2]  
[us\_west\_2:children]  
us-west-2

`

In Ansible 1.9, I used this group as follow:

1. run the playbook with -i inventories/ec2/ prefix

2. use the group as follow:

`

- debug: msg=“{{ hostvars[item].ec2\_private\_ip\_address }}”  
with\_items: groups.us\_west\_2

`

ec2.py did not change, and still return

`

…  
“us-west-2”: [  
“54.213.157.131”,  
“54.191.215.128”,  
“54.186.93.200”,  
“54.186.40.39”  
],  
…

`

Look like Ansible 2 does not use the groups defined in inventories/ec2/hosts.  
Is it bug or a feature?  
any idea how to bypass this issue?

Thanks  
Tzach

---

<div class="post-metadata">

**Author:** ![Tzach\_Livyatan1](https://avatars.discourse-cdn.com/v4/letter/t/9fc29f/32.png) [@Tzach\_Livyatan1](https://forum.ansible.com/u/Tzach_Livyatan1)\
**Post date:** [May 25, 2016, 12:12pm UTC](https://forum.ansible.com/t/upgrading-to-ansible-2-break-ec2-inventory-groups-augmentation/21226/2 "2016-05-25T12:12:04Z")

</div>

Still struggling with this issue  
Any lead will be appreciated

Thanks

---

<div class="post-metadata">

**Author:** ![Johannes\_Kastl](https://avatars.discourse-cdn.com/v4/letter/j/bbe5ce/32.png) [@Johannes\_Kastl](https://forum.ansible.com/u/Johannes_Kastl)\
**Post date:** [May 25, 2016, 1:38pm UTC](https://forum.ansible.com/t/upgrading-to-ansible-2-break-ec2-inventory-groups-augmentation/21226/3 "2016-05-25T13:38:57Z")

</div>

> > As part of it, I'm defining extra groups in file inventories/ec2/hosts,  
> > for example:  
> > [us-west-2]  
> > [us\_west\_2:children]  
> > us-west-2

Is there a typo? Or are you using the group name as child element for  
another group? us-west-2 vs. us\_west\_2

> > Look like Ansible 2 does not use the groups defined in  
> > inventories/ec2/hosts.

What are the exact error messages? Maybe include some more debug tasks  
to output the values.

You had a debug task in your mail, what was the output and was did you  
expect to get?

Johannes

---

<div class="post-metadata">

**Author:** ![Tzach\_Livyatan2](https://avatars.discourse-cdn.com/v4/letter/t/58956e/32.png) [@Tzach\_Livyatan2](https://forum.ansible.com/u/Tzach_Livyatan2)\
**Post date:** [May 26, 2016, 4:10pm UTC](https://forum.ansible.com/t/upgrading-to-ansible-2-break-ec2-inventory-groups-augmentation/21226/4 "2016-05-26T16:10:13Z")

</div>

Hi Johannes  
Thanks for the response

---

<div class="post-metadata">

**Author:** ![Johannes\_Kastl](https://avatars.discourse-cdn.com/v4/letter/j/bbe5ce/32.png) [@Johannes\_Kastl](https://forum.ansible.com/u/Johannes_Kastl)\
**Post date:** [May 26, 2016, 6:31pm UTC](https://forum.ansible.com/t/upgrading-to-ansible-2-break-ec2-inventory-groups-augmentation/21226/5 "2016-05-26T18:31:57Z")

</div>

> As far as I can tell the difference between Ansible 1.9 and 2.0 is the  
> following\*:\*

[...]

> Although the value of {{region\_group}} was us\_west\_2, using a variable as  
> an attribute of groups stopped working on Ansible 2  
> Does this issue ring any bells?

If this worked in 1.9 and does no longer in 2.0, I would say try to  
test it in 2.1, as there have been lots of fixes for regressions  
AFAIK. If it still does not work, create a bug report aka issue on github.

Johannes
