On Tuesday, 27 March 2018 21.38.32 CEST ddrake2...@gmail.com wrote:
> Hi,
> 
> Just looking over the new looping documentation for Ansible 2.5 and I'm not 
> sure how to loop a var number of times. It seems that everything now needs 
> to be a list that is fed into loop. We used to be able to run
> 
> "with_sequence: count=var"
> 
> To loop var number of times. Is there any easy way to do this with the new 
> schema? 

You can still use the with_sequence, it's not going away anytime soon and 
hopefully it will never go away because the new way is horrendous to type. 

  with_sequence: count={{ var }}

equivalent with loop:

  loop: "{{ lookup('sequence', 'count=' + var | string) | list }}"


-- 
Kai Stian Olstad

-- 
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/2700712.xnSNcSeVHr%40x1.
For more options, visit https://groups.google.com/d/optout.

Reply via email to