Closed dougszumski closed 1 year ago
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Unpleasant story. You may end up with a system that won't boot at all.
@mrlesmithjr , please, reopen
Describe the bug
If
ansible-mdadm
is used to manage mdraid devices created via another means, duplicate entries may be created inmdadm.conf
. In the worst case, this may prevent a machine booting.To Reproduce
As an example:
mdadm.conf
. Everything is fine so far. For example:ansible-mdadm
configuration and run the role.ansible-mdadm
writes the output frommdadm --detail --scan
tomdadm.conf
. The regex doesn't match the existing entries, resulting in two entries per device. For example:Expected behaviour
mdadm.conf
, it should be replaced using the format fromansible-mdadm
.I'm happy to submit a patch if we agree on the expected behaviour. It would be easy to match by UUID, rather than the whole
ARRAY
line. However, it could have side effects (removinglevel
,num-devices
from existing entries). Perhaps we should fail if this scenario happens, and prompt the user to take manual, remedial action instead?Many thanks for your excellent work by-the-way.