That, and also this syntax is incorrect because it uses legacy variables
that will be going away:

  with_items: ${user.groups}

Do this:

with_items: user.groups

Thanks!

The official docs already don't do this, but there are a lot of old not
well updated articles on the internet.

I strongly recommend starting with the official docs and
github.com/ansible/ansible-examples for looking at things when possible.

Thanks!


On Wed, Nov 20, 2013 at 4:37 PM, Serge van Ginderachter <
[email protected]> wrote:

>
> On 20 November 2013 22:23, Yoann DAVID <[email protected]> wrote:
>
>> roles/usertest/tasks/main.yml : nothing changed
>>
>>> - include: tasks_user.yml user=$item
>>>   with_items: $users
>>>
>>
> This is your problem. "include:" combined with "with_items" is a non
> documented, non supported idiom.
> While this works when defined in a vars file ( = same variables for all
> hosts, where this can work in a consequent way0), it can't when defined at
> inventory level, which group_vars/all is, and where you could give
> different variable values for different hosts: this can't work, as
> include+with items is parsed at the beginning, before inventory variables
> is looked at!
>
> Don't try both though, It is a deprecated feature in 1.4, and will
> probably be removed in 1.5.
>
> Serge
>
>  --
> 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].
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Michael DeHaan <[email protected]>
CTO, AnsibleWorks, Inc.
http://www.ansibleworks.com/

-- 
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].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to