You might want to take a look at the 'set' filters provided by ansible at
http://docs.ansible.com/playbooks_variables.html#set-theory-filters

I imagine something like:

with_items: groups['A']|union(groups['B'])|unique

would work.

I doubt it is needed, but you might have to add |list onto the end of that.

I think jinja2 addition may also work:

with_items: (groups['A'] + groups['B'])|unique


On Wed, Jun 4, 2014 at 4:57 PM, Dmitry Makovey <[email protected]> wrote:

> nice try - but no dice:
>
> fatal: [192.168.0.138] => with_items expects a list or a set
>
> FATAL: all hosts have already failed -- aborting
>
> I even played a bit and checked python syntax making it:
>
> groups['A'].extend(groups['B'])|set
>
> with or without last "list" filter with original syntax or with my
> "correction" it fails as per above. -vvvv doesn't help much to pinpoint
> where the problem is.
>
> --
> 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/dbf95bca-a694-42ec-b5f8-5a607b202157%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/dbf95bca-a694-42ec-b5f8-5a607b202157%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Matt Martz
[email protected]
http://sivel.net/

-- 
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/CAD8N0v8kpHxPd5q-UiiN%2B7G-CDG7WSCv-Cxv_fwio%2BazPmJ%2Baw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to