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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user