Suppose you have one task that iterates and uses ‘until’ to do nothing but
find out the final number of entries.
Once you have that number you can do a second task to iterate again but now
using a regular loop and use the results etc.

On Thu, 13 Jun 2019 at 06:01, innate new <[email protected]> wrote:

> Hello Folks,
>
> I have a requirement to loop through an REST API, to get data, and I would
> like to use ANSIBLE YAML.
>
> The API itself only renders 400 entries(limit) at a time and hence to get
> the entire data set will need to loop through all offsets incrementing
> every time by 400.
>
> Each time the api is called the resulting JSON has a key which tells
> whether more results are available or not.
>
> The non-trivial piece for me:
>
> 1) The end count is unknown, hence cannot use loop or with_items/stride
> etc.
> 2) The condition to goto next increment is part of the resulting JSON from
> API get.
>
>
> I was able to make this work via python but want to use available URI
> module to do the same.
>
> Any ideas are much appreciated!
>
> thanks
> drake
>
> --
> 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/69cd149d-77db-4d9f-b6af-61afed355071%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/69cd149d-77db-4d9f-b6af-61afed355071%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
-- 
Sent from a mobile device - please excuse the brevity, spelling and
punctuation.

-- 
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/CAL8fbwM45ERMsN01D_jtroB2%2BDeLLxcOOnsLm9M-M79uuoESGg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to