Improve satellite error handling

Improve satellite error handling by retrying until we get a 200 or
a 404 from satellite.    We could be receiving gateway timeouts or
any other "server busy" kind of errors .   This would retry until
we get one of the expected answers.

Change-Id: I7968a63bbd17ddffdba80bb0bcc7cf1e4392cf01
This commit is contained in:
David Hill 2022-06-06 14:10:45 -04:00
parent ef52a27bb3
commit b3a5de82b8
1 changed files with 9 additions and 5 deletions

View File

@ -8,7 +8,7 @@
register: _sat5_check
retries: 3
delay: 5
until: "'status' in _sat5_check"
until: "'status' in _sat5_check and _sat5_check['status'] in [ 200, 404 ]"
run_once: true
ignore_errors: true
tags:
@ -20,24 +20,28 @@
validate_certs: false
status_code:
- 200
- 404
register: _sat6_check_v6
retries: 3
delay: 5
until: "'status' in _sat6_check_v6"
until: "'status' in _sat6_check_v6 and _sat6_check_v6['status'] in [ 200, 404 ]"
run_once: true
ignore_errors: true
tags:
- rhsm_satellite
when: _sat5_check['status'] == 404
- name: Set correct v6 check result
set_fact:
_sat6_check: "{{ _sat6_check_v6 }}"
when:
- _sat6_check_v6 is success
- _sat6_check5['status'] == 404
- _sat6_check_v6['status'] == 200
- name: Block Satellite 6.10
when:
- _sat6_check_v6 is failed
- _sat6_check_v6['status'] == 404
- _sat5_check['status'] == 404
block:
- name: SATELLITE | Check for Satellite 6.10
uri:
@ -50,7 +54,7 @@
run_once: true
retries: 3
delay: 5
until: "'status' in _sat6_check_v610"
until: "'status' in _sat6_check_v610 and _sat6_check_v610['status'] in [ 200, 404 ]"
tags:
- rhsm_satellite