I tried to disable the automatic assembly of mdadm during boot in order to assemble it using my own script. A controller has hiccups sometimes and automatic assembly would result in degraded arrays. Unfortunately, the common hints, e.g., adding

DEVICE /dev/null or AUTO -all

to the mdadm.conf, did not work. They don't work because the initramfs script (at least on Ubuntu) does not use the system's mdadm.conf in case there is no ARRAY line in the file and regenerates a new one for the initramfs. In my case, I did not specify an array as auto detection worked perfectly. So, after including an ARRAY statement and updating the initramfs, the arrays did not get assembled automatically anymore.