Hi Johannes
Thanks for the response

On Wed, May 25, 2016 at 4:38 PM, Johannes Kastl <m...@ojkastl.de> wrote:

> > On Thursday, April 21, 2016 at 10:27:54 AM UTC+3, Tzach Livyatan wrote:
>
> >> 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
>

It is an ugly hack indeed.  I did it to bypass the fact Ansible does no
allow a variable with '-', while ec2.py groups are with '-'.
I will be happy to get rid of it, but as far as I can tell not the issue.


> >> 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?
>

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


*    - debug: msg="{{ hostvars[item].ec2_private_ip_address }}"
with_items: groups.us_west_2*
    - debug: msg="{{ hostvars[item].ec2_private_ip_address }}"
      with_items: groups.{{region_group}}

The first debug works with both Ansible versions, the second failed only on
Ansible 2, with the following error:

TASK [debug]
*******************************************************************
task path: /home/fedora/cassandra-test-and-deploy/stress.yaml:27
fatal: [54.218.71.135]: FAILED! => {"failed": true, "msg":
"'ansible.vars.hostvars.HostVars object' has no attribute
u'groups.us_west_2'"}

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?

Thanks
Tzach



>
> Johannes
>
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Ansible Project" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/ansible-project/qTKRXIWQRow/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> ansible-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/5745AAF1.9090801%40ojkastl.de
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAEB7%3D3axYn-%3D9GJffwkj_QRnJkCJwrbNN1eoKEkzRXbw9d72xg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to