Closed simonkowallik closed 1 year ago
The (error handling) logic within the bigip_provision
module provides a lot of room for race conditions and infinite loops.
If an exception is raised on the previous try block, the below code will possibly lead to an infinite loop unless the if condition is true. https://github.com/F5Networks/f5-ansible/blob/756276916fec21dc74c071edf698657fe74b3ce0/ansible_collections/f5networks/f5_modules/plugins/modules/bigip_provision.py#L410-L413
With an exception raised in the try block, this leads to an infinite loop:
AFM (_wait_for_afm_ready): https://github.com/F5Networks/f5-ansible/blob/756276916fec21dc74c071edf698657fe74b3ce0/ansible_collections/f5networks/f5_modules/plugins/modules/bigip_provision.py#L945-L946
CGNAT (_wait_for_cgnat_ready): https://github.com/F5Networks/f5-ansible/blob/756276916fec21dc74c071edf698657fe74b3ce0/ansible_collections/f5networks/f5_modules/plugins/modules/bigip_provision.py#L981-L982
MGMT (_wait_for_mgmt_ready): https://github.com/F5Networks/f5-ansible/blob/756276916fec21dc74c071edf698657fe74b3ce0/ansible_collections/f5networks/f5_modules/plugins/modules/bigip_provision.py#L1017-L1018
These are just a few examples.
Hi, thanks for reporting this issue. Added to the backlog and internal tracking ID for this request is: INFRAANO-1167, thanks!
COMPONENT NAME
bigip_provision
version 1.22.1Environment
ANSIBLE VERSION
BIGIP VERSION
CONFIGURATION
OS / ENVIRONMENT
SUMMARY
The ansible task using
bigip_provision
hangs forever when the issue occurs. The source of this issue seem to be multiple but none of them seem to occur all the time in all use-cases ofbigip_provision
.It seems to depend on either the number of modules which need to be provisioned, the specific module to provision and/or race condition(s).
Ultimately bigip_provision runs into an infinite loop, which seems to be caused by the logic within bigip_provision and the frequent code that ignores any exceptions ("except Exception: pass").
STEPS TO REPRODUCE
Loop through modules
["asm", "avr", "afm"]
and executing bigip_provision sequentially.EXPECTED RESULTS
Modules get provisioned as expected and the playbook continues
ACTUAL RESULTS
The playbook hangs during execution of the task till it gets stopped by an ansible execution timeout or stopped manually (after hours...)