Upgrading to Ansible 2 break EC2 inventory groups augmentation

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

Still struggling with this issue
Any lead will be appreciated

Thanks

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

Hi Johannes
Thanks for the response

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