I thought I'd ask here before submitting a bug report in case I was just
doing something wrong.
I have this task:
- name: run test
uri:
url: "http://0.0.0.0:3030/dbstatus"
register: result
until: result['status']|default(0) == 200
The default number of retries is 3 for the do-until loop. I noticed that
the task was using all the retries before succeeding so I assumed it was
just taking that long to get a 200 so I changed retries to 10 just to see
how long it usually takes. At that point it used all the retries AGAIN so I
took a look at the output:
FAILED - RETRYING: TASK: csm.api : run test (9 retries left). Result was:
{
'status': 200,
'content_length': '17122',
'changed': False,
'x_powered_by': 'Express',
'connection': 'keep-alive',
'date': 'Sun, 22 May 2016 18:23:43 GMT',
'json': {
'stuff'
},
'redirected': False
}
*Why was the task being retried when 'status' was already 200? *
So I tried changing the check to see if the do-until loop was working at
all:
until: result['status']|default(0) == 255
Clearly, this *should *fail, and yet, after using *all *the retries, it
succeeds.
Let me know if there is something I am doing wrong, otherwise I will submit
a bug report. 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/d62e7e32-481e-46e5-b4de-971957703d30%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.