Skip to content

Commit

Permalink
Merge pull request #220 from RLTravis/develop
Browse files Browse the repository at this point in the history
PR related to Issue #219
  • Loading branch information
joewesch authored Jul 3, 2023
2 parents ea48b99 + 16af02d commit 548fcca
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 2 deletions.
8 changes: 8 additions & 0 deletions plugins/modules/device_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@
required: true
type: raw
version_added: "3.0.0"
status:
description:
- The status of the interface
- Required if I(state=present) and using I(api_version) 1.4+
required: false
type: raw
version_added: "4.4.0"
name:
description:
- Name of the interface to be created
Expand Down Expand Up @@ -230,6 +237,7 @@ def main():
dict(
update_vc_child=dict(type="bool", required=False, default=False),
device=dict(required=True, type="raw"),
status=dict(required=False, type="raw"),
name=dict(required=True, type="str"),
label=dict(required=False, type="str"),
type=dict(required=False, type="str"),
Expand Down
4 changes: 2 additions & 2 deletions plugins/modules/relationship_association.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
description:
- The Relationship UUID to add the association to
required: true
type: str
type: raw
source_type:
description:
- The app_label.model for the source of the relationship
Expand Down Expand Up @@ -102,7 +102,7 @@ def main():
argument_spec = deepcopy(NAUTOBOT_ARG_SPEC)
argument_spec.update(
dict(
relationship=dict(required=True, type="str"),
relationship=dict(required=True, type="raw"),
source_type=dict(required=True, type="str"),
source_id=dict(required=True, type="str"),
destination_type=dict(required=True, type="str"),
Expand Down
29 changes: 29 additions & 0 deletions tests/integration/targets/latest/tasks/device_interface.yml
Original file line number Diff line number Diff line change
Expand Up @@ -288,3 +288,32 @@
that:
- test_eleven is failed
- test_eleven['msg'] == "Must set update_vc_child to True to allow child device interface modification"


- name: "12 - Interface with status"
networktocode.nautobot.device_interface:
url: "{{ nautobot_url }}"
token: "{{ nautobot_token }}"
device: test100
api_version: "{{ nautobot_version }}"
name: GigabitEthernet9999
status: planned
type: "1000Base-T (1GE)"
register: test_twelve
when:
# Status is mandatory only on Nautobot 1.4+
- "nautobot_version is version('1.4', '>=')"

- name: "12 - ASSERT"
assert:
that:
- test_twelve is changed
- test_twelve['msg'] == "interface GigabitEthernet9999 created"
- test_twelve['diff']['before']['state'] == 'absent'
- test_twelve['diff']['after']['state'] == 'present'
- test_twelve['interface']['name'] == "GigabitEthernet9999"
- test_twelve['interface']['status'] == "planned"
- test_twelve['interface']['device'] == test100['key']
when:
# Status is mandatory only on Nautobot 1.4+
- "nautobot_version is version('1.4', '>=')"

0 comments on commit 548fcca

Please sign in to comment.