Skip to content

Commit

Permalink
feat: metal_vlan to return metal_gateway field from api response (#199)
Browse files Browse the repository at this point in the history
it might be useful to know the metal gateways on a vlan, so it makes
sense to expose it in this module
  • Loading branch information
ctreatma authored Jul 22, 2024
2 parents 08b3ffd + 4a51cee commit c7b2c75
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions plugins/module_utils/metal/metal_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ def get_assignment_address(resource: dict):
"facility": optional("facility"),
"vxlan": "vxlan",
"tags": "tags",
"metal_gateways": "metal_gateways",
}

METAL_CONNECTION_RESPONSE_ATTRIBUTE_MAP = {
Expand Down
9 changes: 9 additions & 0 deletions tests/integration/targets/metal_gateway/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,15 @@
that:
- "listed_gateways.resources | length == 2"

- name: get vlan for test
equinix.cloud.metal_vlan:
id: "{{ vlan.id }}"
register: vlan

- assert:
that:
- "vlan.metal_gateways | length == 2"

- name: delete gateways
equinix.cloud.metal_gateway:
id: "{{ item.id }}"
Expand Down

0 comments on commit c7b2c75

Please sign in to comment.