Ansible sometimes behaves differently when i execute the same script multiple times. Examples:
- Once, name for TASKS were not shown when script was run 1st time. Name was shown the 2nd time.
- It showed command timeoput of 10 secs reached and script failed but same script executed earlier ran till the end.
- For below TASK, ansible kept saying that ‘-’ was missing under when statement even though it was there. Then i removed the entire line and retyped everything and ansible didn’t find anything.
assert:
that:
- “‘f148fc860a1d4d08532bc616724e632d’ in md5_flash3.stdout[0]”
fail_msg: “MD5 VERIFICATION FAILED FOR FLASH2. PLAYBOOK IS ENDING”
success_msg: “MD5 VERIFICATION IS SUCCESSFUL FOR FLASH2”
when: - “‘Switch 03’ in print_showversion.stdout[0]”
- “‘c2960x-universalk9-mz.152-7.E3.bin’ in image_flash3.stdout[0]”
I run ansible 2.9 on linux VM and GNS3 and network connection was stable when i got above errors. Have you experienced these issues? Any way to make ansible more stable?