Use with_indexed_items instead

http://docs.ansible.com/ansible/latest/playbooks_loops.html#looping-over-a-list-with-an-index

On Thu, Nov 30, 2017 at 10:09 AM Moris Amar <[email protected]> wrote:

> Hi,
>
> I want to have a counter (incrementation) in "with_items" in order to look
> over a list (index).
>
>   ec2_metric_alarm:
>
> ...
>     description: '{{ item.ec2_alarm_description }}'
>     dimensions: '{{item.ec2_alarm_dimensions }}'
>     alarm_actions: '{{ ec2_scaling_policy_reg.results[*0*].arn }}'
>   with_items: '{{ ec2_metric_alarm_item }}'
>
> Any suggestion?
>
> thanks
>
>
>
>
> --
> 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/5f140311-07c9-4999-8a56-810f8a0c71ea%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/5f140311-07c9-4999-8a56-810f8a0c71ea%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
-- 
Matt Martz
@sivel
sivel.net

-- 
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/CAD8N0v-Ri-NpqhyArDWxZs%3DGyhNLVo864cUUPDMd8MtswwHryg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to