Fix retry mechanism

If the wrong status code is returned, ansible sets failed: true.
This means that a retry is never attempted.

Use .get('status') to work around the possibility that a status
may not be returned in some corner cases. For example:

TASK [grafana : Wait for grafana application ready]
***************** fatal: [some_remote_node]: FAILED! =>
{"failed": true, "msg": "The conditional check 'result.status
== 200' failed. The error was: error while evaluating
conditional (result.status == 200): 'dict object' has no
attribute 'status'"}

Change-Id: I14207d1a9e994fa25c1c061025fff5b64a71d690
Closes-Bug: #1742501
This commit is contained in:
Doug Szumski 2018-01-24 14:59:35 +00:00
parent 3318cbd19b
commit dafe39dfb6

View File

@ -4,7 +4,7 @@
url: "{{ internal_protocol }}://{{ kolla_internal_vip_address }}:{{ grafana_server_port }}/login"
status_code: 200
register: result
until: result | failed or result.status == 200
until: result.get('status') == 200
retries: 10
delay: 2
run_once: true