Skip to content

Commit f1ea03a

Browse files
authored
feat: Add status and facility options to netbox_location module (#1282)
* feat: Add `status` and `facility` options to `netbox_location` module This commit adds the `status` and `facility` options to the `netbox_location` module. The `status` option allows specifying the status of the location, while the `facility` option allows specifying the data center provider or facility. These options were added to enhance the functionality of the module and provide more flexibility in managing locations within NetBox. Fixes #1279, #1280 * remove extra space found in linting
1 parent a271a54 commit f1ea03a

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
minor_changes:
2+
- Add ``status`` to ``location`` (https://github.com/netbox-community/ansible_modules/issues/1279)
3+
- Add ``facility`` to ``location`` (https://github.com/netbox-community/ansible_modules/issues/1280)

plugins/modules/netbox_location.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@
3434
- The name of the location
3535
required: true
3636
type: str
37+
status:
38+
description:
39+
- Status of the location
40+
required: false
41+
type: raw
42+
version_added: "3.20.0"
3743
slug:
3844
description:
3945
- The slugified version of the name or custom slug.
@@ -56,6 +62,12 @@
5662
required: false
5763
type: raw
5864
version_added: "3.8.0"
65+
facility:
66+
description:
67+
- Data center provider or facility, ex. Equinix NY7
68+
required: false
69+
type: str
70+
version_added: "3.20.0"
5971
description:
6072
description:
6173
- The description of the location
@@ -93,14 +105,16 @@
93105
site: Test Site
94106
state: present
95107
96-
- name: Create location within NetBox with a parent location
108+
- name: Create location within NetBox with a parent location, status and facility
97109
netbox.netbox.netbox_location:
98110
netbox_url: http://netbox.local
99111
netbox_token: thisIsMyToken
100112
data:
101113
name: Child location
102114
site: Test Site
103115
parent_location: Test location
116+
status: planned
117+
facility: Test Facility
104118
state: present
105119
106120
- name: Delete location within NetBox
@@ -146,10 +160,12 @@ def main():
146160
required=True,
147161
options=dict(
148162
name=dict(required=True, type="str"),
163+
status=dict(required=False, type="raw"),
149164
slug=dict(required=False, type="str"),
150165
site=dict(required=False, type="raw"),
151166
parent_location=dict(required=False, type="raw"),
152167
tenant=dict(required=False, type="raw"),
168+
facility=dict(required=False, type="str"),
153169
description=dict(required=False, type="str"),
154170
tags=dict(required=False, type="list", elements="raw"),
155171
custom_fields=dict(required=False, type="dict"),

0 commit comments

Comments
 (0)