Why is ansible so buggy?

Ansible sometimes behaves differently when i execute the same script multiple times. Examples:

  1. Once, name for TASKS were not shown when script was run 1st time. Name was shown the 2nd time.
  2. It showed command timeoput of 10 secs reached and script failed but same script executed earlier ran till the end.
  3. 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?

For the example you have shown us, I would very carefully check your
indentation, and especially whether some lines have spaces and some have tabs.

For the examples you have not shown us, I have no idea. Give us more detail
and we might be able to help.

Antony.