The first problem here is not about sets or unions or anything.

The issue is with_items wants a single list to walk over, not a list of two
lists.

So

with_items:  variable_ame

works

as does

with_items:
   - dog
   - cat
   - fish

With hard coded strings

But if you want to walk two lists, that's "with_nested".

Here, though you do want to add them together.

I just wanted to mention why you were seeing "groups["A"]" literally in the
first logfile above.



On Thu, Jun 5, 2014 at 10:26 AM, C. Morgan Hamill <[email protected]>
wrote:

> Excerpts from Dmitry Makovey's message of 2014-06-04 18:17:04 -0400:
> > Winning combination turned out to be:
> >
> > ( groups['A']+groups['B'] ) | unique
> >
> > I do like how simple it looks vs
> >
> > ( groups['A']|union (groups['B']))| unique
>
> Just FYI, the 'unique filter in the latter form is redundant; this
> should work fine:
>
>     groups['A']|union(groups['B')
>
> Sets, by definition, have no duplicate items.
> --
> Morgan
>
> --
> 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 [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/1401978298-sup-8285%40al.wesleyan.edu
> .
> 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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgwP24dioO_kXnXLYSxCBm49CSwDtTOH%3DYc1i_5UpBdTvg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to