nutanix.ansible icon indicating copy to clipboard operation
nutanix.ansible copied to clipboard

[Imprv] add functionality to update subnets to module ntnx_subnets

Open bhati-pradeep opened this issue 2 years ago • 4 comments

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

bhati-pradeep avatar Oct 31 '22 06:10 bhati-pradeep

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 avatar Jan 17 '23 10:01 OpsCharlie

@OpsCharlie It is expected as subnet update is not yet supported. So for state="present" it will aways try to create a new subnet.

bhati-pradeep avatar Jan 17 '23 10:01 bhati-pradeep

https://github.com/nutanix/nutanix.ansible/pull/424

gdmjoho avatar Oct 24 '23 07:10 gdmjoho