Thanks for those points, I admit the synthax of variable are quite unclear
for me :
- $myvar
- ${myvar}
- {{ myvar }}
- myvar
- myvar.nestedvar
- mavar["nestedvar"]
So many synthax I had to re-read the doc.
And +1 for old tuto on Internet, Ansible is quite young but it progress so
quickly...
Le mercredi 20 novembre 2013 23:24:48 UTC+1, Michael DeHaan a écrit :
>
> 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] <javascript:>> wrote:
>
>>
>> On 20 November 2013 22:23, Yoann DAVID <[email protected]
>> <javascript:>>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] <javascript:>.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>
>
> --
> Michael DeHaan <[email protected] <javascript:>>
> 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.