Okay, looking more closely I think I see. I don't believe "results" becomes
populated in a loop object until the end of the first iteration and with a
retry technically you have never ended that first iteration. What I would
do then is this:

include_tasks: register_environment
loop:
  - 3
  - 4
  etc


---
# file: register_environment.yml

- task:
  your whole task as you wrote it with retries

This will bring the task out of a loop by using the file include and I
believe it will handle register normally (as in "result" will be available
for retry for initial iteration)


On Fri, Sep 6, 2019, 10:14 AM Cade Lambert <[email protected]> wrote:

> I tested that just now.  It doesn't work. The API doesn't send a response
> about the status of the promote task.  When I make the call to promote, it
> immediately responds with info that it started, and that's all.  So the
> solution Kai provided really just keeps sending the same API request using
> the same loop item, because it never gets a response back from the API
> about result.
>
> root@tower /etc/ansible/playbooks $ ansible-playbook test.yml
>
> PLAY [localhost]
> ********************************************************************************************************************************************************************************************************************************
>
> TASK [Gathering Facts]
> **************************************************************************************************************************************************************************************************************************
> ok: [localhost]
>
> TASK [Promote new RHEL7 version to Lifecycle Environments]
> **************************************************************************************************************************************************************************************
> FAILED - RETRYING: Promote new RHEL7 version to Lifecycle Environments (10
> retries left).
> FAILED - RETRYING: Promote new RHEL7 version to Lifecycle Environments (9
> retries left).
> FAILED - RETRYING: Promote new RHEL7 version to Lifecycle Environments (8
> retries left).
> FAILED - RETRYING: Promote new RHEL7 version to Lifecycle Environments (7
> retries left).
> FAILED - RETRYING: Promote new RHEL7 version to Lifecycle Environments (6
> retries left).
> FAILED - RETRYING: Promote new RHEL7 version to Lifecycle Environments (5
> retries left).
> FAILED - RETRYING: Promote new RHEL7 version to Lifecycle Environments (4
> retries left).
> FAILED - RETRYING: Promote new RHEL7 version to Lifecycle Environments (3
> retries left).
>
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/4a97a600-72be-40eb-a712-b637736978d6%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/4a97a600-72be-40eb-a712-b637736978d6%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAKEXu84M23WzuCbm_QDz%2BAYz%3DO2zbaN1vywdcba4AadgiCAFCw%40mail.gmail.com.

Reply via email to