Open vishvikkrishnan opened 7 months ago
So you have a variable defined from where you can remove the faulty one, apply
, then add it again.
Feels to me like usual OpenTofu behavior mixed with a lack of state flow support in the provider. But how would you model the latter? I feel the MAAS API is not ready for it either.
The
maas_machine
resource does not remove unsuccessfully added machines (with a wrong 'power_address', previously existing 'pxe_mac_address', or duplicate 'hostname'), resulting in those machines showing as New in MAAS. The destroy action for such wrongly added machines does nothing.However, when the correct details are passed and the resource is reapplied, errors are thrown because the wrongly added machines haven't yet been deleted.
The resource should clean up any failed nodes that weren't added to ensure resource idempotency. Currently, I have to manually remove them MAAS before reattempting a
terraform apply
.Tested with the following
maas_machine
resource on the TF MAAS provider version 2.0: