Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add description to Rack Role #1143

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions plugins/modules/netbox_rack_role.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@
- Hexidecimal code for a color, ex. FFFFFF
required: false
type: str
description:
description:
- Description of the rack role
required: false
type: str
version_added: "3.17.0"
tags:
description:
- The tags to add/update
Expand Down Expand Up @@ -77,6 +83,16 @@
color: FFFFFF
state: present

- name: Create rack role within NetBox with a description
netbox.netbox.netbox_rack_role:
netbox_url: http://netbox.local
netbox_token: thisIsMyToken
data:
name: Test rack role
color: FFFFFF
description: This is a test rack role
state: present

- name: Delete rack role within netbox
netbox.netbox.netbox_rack_role:
netbox_url: http://netbox.local
Expand Down Expand Up @@ -122,6 +138,7 @@ def main():
name=dict(required=True, type="str"),
slug=dict(required=False, type="str"),
color=dict(required=False, type="str"),
description=dict(required=False, type="str"),
tags=dict(required=False, type="list", elements="raw"),
custom_fields=dict(required=False, type="dict"),
),
Expand Down
2 changes: 2 additions & 0 deletions tests/integration/targets/v3.6/tasks/netbox_rack_role.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
data:
name: Rack Role
color: "003EFF"
description: "This is a Rack Role test"
state: present
register: test_three

Expand All @@ -61,6 +62,7 @@
- test_three['rack_role']['name'] == "Rack Role"
- test_three['rack_role']['slug'] == "rack-role"
- test_three['rack_role']['color'] == "003eff"
- test_three['rack_role']['description'] == "This is a Rack Role test"
- test_three['msg'] == "rack_role Rack Role updated"

- name: "RACK_ROLE 4: Delete"
Expand Down