There is a do-until loop:
<a href="https:&#x2F;&#x2F;docs.ansible.com&#x2F;ansible&#x2F;playbooks_loops.html#id22" rel="nofollow">https:&#x2F;&#x2F;docs.ansible.com&#x2F;ansible&#x2F;playbooks_loops.html#id22</a><p>Which satisfies the infinite loop issue.<p>Have not looked carefully at the dynamic allocation, but I am guessing (hand waving here....) that it could be accomplished.