could you change the vars definition to:
containers:
- hostname : "test"
lxc_rootfs : '{{ lxc_dir }}/{{ hostname }}/rootfs'
lxc_mount : '{{ lxc_dir }}/{{ hostname }}/fstab'
...
this should make item.hostname work
On Thu, Nov 20, 2014 at 10:49 PM, Luis M. Ibarra
<[email protected]> wrote:
> It doesn't work.
>
> I tried with:
>
> - name: LXC - Debug
> debug: msg={{item.[0].hostname}}
> with_items: containers
>
>
> ok: [127.0.0.1] => (item={'hostname': 'test', 'lxc_utsname':
> u'{{hostname}}', 'lxc_network_flags': u'{{| default(up)}}', 'lxc_arch':
> u'x86_64', 'lxc_ip
> _addr': '10.0.3.101', 'lxc_rootfs': u'{{lxc_dir}}/{{hostname}}/rootfs',
> 'lxc_network_link': u'{{| default(link)}}', 'lxc_prefix_ip_addr': '24',
> 'lxc_br
> oadcast_addr': '10.0.0.255', 'lxc_network_type': u'{{| default(veth)}}',
> 'lxc_mount': u'{{lxc_dir}}/{{hostname}}/fstab', 'lxc.network.ipv4':
> u'{{lxc_ip
> _addr}}/{{lxc_prefix_ip_addr}} {{lxc_broadcast_addr}}',
> 'lxc.network.ipv4.gateway': '10.0.3.1'}) => {
> "item": {
> "hostname": "test",
> "lxc.network.ipv4": "{{lxc_ip_addr}}/{{lxc_prefix_ip_addr}}
> {{lxc_broadcast_addr}}",
> "lxc.network.ipv4.gateway": "10.0.3.1",
> "lxc_arch": "x86_64",
> "lxc_broadcast_addr": "10.0.0.255",
> "lxc_ip_addr": "10.0.3.101",
> "lxc_mount": "{{lxc_dir}}/{{hostname}}/fstab",
> "lxc_network_flags": "{{| default(up)}}",
> "lxc_network_link": "{{| default(link)}}",
> "lxc_network_type": "{{| default(veth)}}",
> "lxc_prefix_ip_addr": "24",
> "lxc_rootfs": "{{lxc_dir}}/{{hostname}}/rootfs",
> "lxc_utsname": "{{hostname}}"
> },
> "msg": "{{item.[0].hostname}}"
> }
>
> No success obtaining the dictionary values.
>
>
> 2014-11-20 22:04 GMT-05:00 Brian Coca <[email protected]>:
>>
>> try item[0].hostname
>>
>>
>>
>> --
>> Brian Coca
>>
>> --
>> 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/CAJ5XC8m%2BLoNo7xDxWm_hC2trEXCN11ttZ9nSm%3DfVsUBScpdnoA%40mail.gmail.com.
>> For more options, visit https://groups.google.com/d/optout.
>
>
>
>
> --
> Luis M. Ibarra
>
> --
> 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/CAFyQ8TSeymhgKzGLzeL-hzZZWkkDo%3DBK4hRA2X1i5tNmYnpMYA%40mail.gmail.com.
>
> For more options, visit https://groups.google.com/d/optout.
--
Brian Coca
--
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/CAJ5XC8nOvtz163GVacSXiQAs64kCLTo9P8%2Bg93gk8jRLK5LnFg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.