Closed ctreatma closed 1 month ago
Fixing this will require more than marking the fields as editable. The get_diff
function will only allow an attribute to be changed if it has a non-null value in both the task config and the API response: https://github.com/equinix/ansible-collection-equinix/blob/4c832641034f5354d82292b673bbfd17e75dbc16/plugins/module_utils/equinix.py#L259
We could potentially tweak get_diff
to allow more attribute changes, but that function is used in almost every Metal module. IMO it would be better to stop using that function and allow each module to decide when an attribute should be added/updated/removed, since the decision will likely be slightly different across modules, or even for different attributes within a single module.
This issue has been resolved in version 0.11.1 :tada:
SUMMARY
The
metal_virtual_circuit
module only updates thename
attribute (and only updates that attribute ifid
is also provided, sincename
is used for lookups ifid
is absent).As with many plugins in this collection, updates are limited to attributes that are defined as mutable:
editable
in the module spec: https://github.com/equinix/ansible-collection-equinix/blob/d31f17a57cd8a904463ef69fca5d0dabfb982cad/plugins/modules/metal_virtual_circuit.py#L352-L354id
orname
: https://github.com/equinix/ansible-collection-equinix/blob/d31f17a57cd8a904463ef69fca5d0dabfb982cad/plugins/modules/metal_virtual_circuit.py#L387-L394ISSUE TYPE
COMPONENT NAME
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
STEPS TO REPRODUCE
EXPECTED RESULTS
ACTUAL RESULTS