On 20.01.17 15:01 Stepan Harutyunyan wrote:
> Thank you Johannes,
> 
> i put msg: "{{array[item]['contactId']}}"
> 
> but i got following error:
> 
> fatal: [10.137.25.64]: FAILED! => {"failed": true, "msg": "the
> field 'args' has an invalid value, which appears to include a
> variable that is undefined. The error was: 'list object' has no
> attribute u'3'

Obviously arrays do not like to be treated like a list...

https://docs.ansible.com/ansible/playbooks_variables.html#accessing-complex-variable-data

Does this at least spit out something?
msg: "{{array[ [ item ] ]}}"

msg: "{{array[ [ item ] ]['contactId'] }}"

I guess the array needs the square brackets, and AFAIK you get the
value of a variable by putting it in square brackets, when you are
inside the double curly ones...

Otherwise separating with commas might be an alternative.

Johannes

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/1cb61a5f-e47c-653f-8298-48e369038aae%40ojkastl.de.
For more options, visit https://groups.google.com/d/optout.

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to