Closed netixx closed 3 years ago
Thanks for opening this issue. Is this issue related to #228 where it seems exception is related to authentication issue ?
Not specifically.
Most of the authentication errors we are getting are during the initial connection/token retrieval (we get "Invalid Crendentials" as a return message in this case). This is where RADIUS authentication occurs (and may fail due to transient RADIUS failure).
Since all the backend function to communicate with Cloudvision has moved to cvprac library, this feature request should be routed to this repository.
It is best to implement such a mechanism directly in the authentication process instead of per module.
Once the issue will be opened there, I will spend time to submit a PR
Request Type
Detailed Description
While interacting with CVP, the API may fail temporarily (eg. radius authentication, transient failures due to load of the machine). There may also be transient network or DNS failures.
When this happens, the ansible-cvp module crashes immediately.
This impeeds automations flows, and they need to be restarted from scratch. In complex environment, this wastes a lot of time.
We could add a basic retry mecanism in the code, which retries requests when (some kind) of failures occur.
Context
This is a backend change, nothing would change for the user, except the module would crash less often when retries are enabled.
Add any other context or screenshots about the feature request here.
Possible Implementation
We could add a switch for the number of retries (0 disables the feature, default 3), and output a warning when those errors occurs.
Ansible "recover" blocks are an alternative, but is more complex to implement on the user's side.