nutanix.ansible
nutanix.ansible copied to clipboard
[Imprv] add functionality to update subnets to module ntnx_subnets
Describe the request Add functionality to update subnets in ntnx_subnets. Identify such subnet components which can be updated and add functionality as per that.
Current behaviour It only allows creation and delete
Expected behaviour Should be able to update subnet
Refer docs: https://www.nutanix.dev/api_references/prism-central-v3/#/c4c4a9a81a449-update-a-existing-subnet
I have the same issue.
When using name
it creates a duplicate subnet
- name: VLAN subnet with IPAM, IP pools and DHCP
nutanix.ncp.ntnx_subnets:
name: "{{ ntnx_subnet.name }}"
state: present
vlan_subnet:
vlan_id: "{{ ntnx_subnet.vlan_id }}"
....
When using subnet_uuid
to "update" the subnet, it is mutual excluded:
- name: VLAN subnet with IPAM, IP pools and DHCP
nutanix.ncp.ntnx_subnets:
subnet_uuid "{{ ntnx_subnet.name }}"
vlan_subnet:
vlan_id: "{{ ntnx_subnet.vlan_id }}"
....
fatal: [localhost]: FAILED! => {"changed": false, "msg": "parameters are mutually exclusive: vlan_subnet|external_subnet|subnet_uuid|overlay_subnet"}
@OpsCharlie It is expected as subnet update is not yet supported. So for state="present" it will aways try to create a new subnet.
https://github.com/nutanix/nutanix.ansible/pull/424