equinix / ansible-collection-equinix

Ansible content to help automate the management of Equinix resources
https://deploy.equinix.com/labs/ansible-collection-equinix/
GNU General Public License v3.0
1 stars 1 forks source link

Virtual circuit module only allows updating name #237

Closed ctreatma closed 1 month ago

ctreatma commented 1 month ago
SUMMARY

The metal_virtual_circuit module only updates the name attribute (and only updates that attribute if id is also provided, since name is used for lookups if id is absent).

As with many plugins in this collection, updates are limited to attributes that are defined as mutable:

ISSUE TYPE
COMPONENT NAME
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
STEPS TO REPRODUCE
EXPECTED RESULTS
ACTUAL RESULTS
ctreatma commented 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.

github-actions[bot] commented 1 month ago

This issue has been resolved in version 0.11.1 :tada: