Syntax to access item in with_sequence in a complex variable

Hi everyone

I’m trying to use the item value in ‘with_sequence’ to access an element in my array variable.

I understand that to access variables using the bracket syntax […] in

  • vars => use vars[…]

  • hostvars => use hostvars[…]

But how to access an item in with_sequence using the bracket syntax […]?

`

Ok I just found the right syntax… [item | int]

command: “{{ script_path }}/send-commands.exp {{ mgmt_prefix_ip }}.{{ item | int + vars[‘mgmt_start_ip’] }} {{ username }} {{ password }} {{ config_path }}/{{ vars[‘device’][item | int][‘hostname’] }}.txt”