diff --git a/_modules/maasng.py b/_modules/maasng.py index 1939b80..65ffc84 100644 --- a/_modules/maasng.py +++ b/_modules/maasng.py @@ -870,7 +870,7 @@ def get_fabric(fabric): return {"error": "Frabic not found on MaaS server"} -def update_vlan(name, fabric, vid, description, dhcp_on=False): +def update_vlan(name, fabric, vid, description, primary_rack, dhcp_on=False): ''' Update vlan @@ -886,6 +886,7 @@ def update_vlan(name, fabric, vid, description, dhcp_on=False): "name": name, "dhcp_on": str(dhcp_on), "description": description, + "primary_rack": primary_rack, } maas = _create_maas_client() fabric_id = get_fabric(fabric) diff --git a/_states/maasng.py b/_states/maasng.py index ad30025..cbe8b5d 100644 --- a/_states/maasng.py +++ b/_states/maasng.py @@ -325,7 +325,7 @@ def select_boot_disk(hostname, name): return ret -def update_vlan(name, fabric, vid, description, dhcp_on=False): +def update_vlan(name, fabric, vid, description, primary_rack, dhcp_on=False): ''' :param name: Name of vlan @@ -333,6 +333,7 @@ def update_vlan(name, fabric, vid, description, dhcp_on=False): :param vid: Vlan id :param description: Description of vlan :param dhcp_on: State of dhcp + :param primary_rack: primary_rack ''' @@ -342,7 +343,7 @@ def update_vlan(name, fabric, vid, description, dhcp_on=False): 'comment': 'Module function maasng.update_vlan executed'} ret["changes"] = __salt__['maasng.update_vlan']( - name=name, fabric=fabric, vid=vid, description=description, dhcp_on=dhcp_on) + name=name, fabric=fabric, vid=vid, description=description, primary_rack=primary_rack, dhcp_on=dhcp_on) if "error" in fabric: ret['comment'] = "State execution failed for fabric {0}".format(fabric) diff --git a/maas/region.sls b/maas/region.sls index e129457..e9711ea 100644 --- a/maas/region.sls +++ b/maas/region.sls @@ -253,6 +253,7 @@ maas_update_vlan_for_{{ fabric_name }}_{{ vid }}: - fabric: {{ fabric_name }} - name: {{ vlan.get('name','') }} - description: {{ vlan.description }} + - primary_rack: {{ region.maas_config.maas_name }} - dhcp_on: {{ vlan.get('dhcp','False') }} {%- endfor %} {%- endfor %}