Ansible task (maas.maas.network_interface_link) troubles

I’m playing around with the Ansible collection maas.maas and am running up against an issue that I’m not understanding when attempting to create a network interface link via a playbook.

I have a machine in MaaS, and I’m trying to add a static IP assignment to it using the following info:

    - name: Create Interface
      maas.maas.network_interface_physical:
        cluster_instance:
          host: "{{ maas_api_host }}"
          token_key: "{{ maas_api_token_key }}"
          token_secret: "{{ maas_api_token_secret }}"
          customer_key: "{{ maas_api_customer_key }}"
        machine: "{{ maas_machine_name }}.{{ maas_machine_domain }}"
        state: present
        mac_address: "{{ machine_mac_address }}"
        vlan: 1
        name: "mgmt0"

    - name: Assign IP Address
      maas.maas.network_interface_link:
        cluster_instance:
          host: "{{ maas_api_host }}"
          token_key: "{{ maas_api_token_key }}"
          token_secret: "{{ maas_api_token_secret }}"
          customer_key: "{{ maas_api_customer_key }}"
        machine: "some-machine.maas"
        state: present
        mode: STATIC
        network_interface: "mgmt0"
        subnet: 10.0.0.0/16
        ip_address: 10.0.121.1
        default_gateway: True

I keep hitting the following error:

TASK [Create Interface] ************************************************************
ok: [localhost]

TASK [IP Address] ******************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "subnet - 10.0.0.0/16 does not have the same fabric. Try another subnet or change fabric."}

I don’t fully understand what that error message is trying to tell me so I’m reaching out to the community here.

Thanks!

Debugging this some more, I’ve found that after creation, the interface is stating it is not connected.

So after telling MaaS via the WebUI to connect it, I tried again with the playbook but the same error was present.

I then configured it further by setting the subnet, fabric, and IP address manually via the WebUI again, and choosing a different IP address than the one I wanted to set, ran the playbook, and it worked :man_shrugging:

Subsequent runs fail though, so it seems like that maas.maas.network_interface_link might not be idempotent.