Skip to content

Commit

Permalink
Merge pull request #275 from joewesch/205_fixup-location
Browse files Browse the repository at this point in the history
Add additional parameters to location
  • Loading branch information
joewesch authored Nov 22, 2023
2 parents 91c7ea9 + c8848e7 commit 2a96a7e
Show file tree
Hide file tree
Showing 3 changed files with 124 additions and 3 deletions.
101 changes: 99 additions & 2 deletions plugins/modules/location.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
version_added: "4.3.0"
extends_documentation_fragment:
- networktocode.nautobot.fragments.base
- networktocode.nautobot.fragments.tags
- networktocode.nautobot.fragments.custom_fields
options:
id:
Expand Down Expand Up @@ -59,6 +60,78 @@
- The parent location this location should be tied to
required: false
type: raw
tenant:
description:
- The tenant the location will be assigned to
required: false
type: raw
version_added: "5.1.0"
facility:
description:
- Data center provider or facility, ex. Equinix NY7
required: false
type: str
version_added: "5.1.0"
asn:
description:
- The ASN associated with the location
required: false
type: int
version_added: "5.1.0"
time_zone:
description:
- Timezone associated with the location, ex. America/Denver
required: false
type: str
version_added: "5.1.0"
physical_address:
description:
- Physical address of location
required: false
type: str
version_added: "5.1.0"
shipping_address:
description:
- Shipping address of location
required: false
type: str
version_added: "5.1.0"
latitude:
description:
- Latitude in decimal format
required: false
type: str
version_added: "5.1.0"
longitude:
description:
- Longitude in decimal format
required: false
type: str
version_added: "5.1.0"
contact_name:
description:
- Name of contact for location
required: false
type: str
version_added: "5.1.0"
contact_phone:
description:
- Contact phone number for location
required: false
type: str
version_added: "5.1.0"
contact_email:
description:
- Contact email for location
required: false
type: str
version_added: "5.1.0"
comments:
description:
- Comments for the location. This can be markdown syntax
required: false
type: str
version_added: "5.1.0"
"""

EXAMPLES = r"""
Expand Down Expand Up @@ -95,8 +168,19 @@
location_type:
name: My Location Type
description: My Nested Location Description
parent_location:
name: My Location
tenant: Test Tenant
facility: EquinoxCA7
asn: "65001"
time_zone: America/Los Angeles
physical_address: Hollywood, CA, 90210
shipping_address: Hollywood, CA, 90210
latitude: "10.100000"
longitude: "12.200000"
contact_name: Jenny
contact_phone: 867-5309
contact_email: jenny@example.com
comments: "**This** is a `markdown` comment"
parent_location: My Location
state: present
"""

Expand Down Expand Up @@ -133,6 +217,19 @@ def main():
description=dict(required=False, type="str"),
location_type=dict(required=False, type="raw"),
parent_location=dict(required=False, type="raw"),
tenant=dict(required=False, type="raw"),
facility=dict(required=False, type="str"),
asn=dict(required=False, type="int"),
time_zone=dict(required=False, type="str"),
physical_address=dict(required=False, type="str"),
shipping_address=dict(required=False, type="str"),
latitude=dict(required=False, type="str"),
longitude=dict(required=False, type="str"),
contact_name=dict(required=False, type="str"),
contact_phone=dict(required=False, type="str"),
contact_email=dict(required=False, type="str"),
comments=dict(required=False, type="str"),
tags=dict(required=False, type="list", elements="raw"),
custom_fields=dict(required=False, type="dict"),
)
)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "nautobot_ansible_modules"
version = "5.0.1"
description = "Ansible collection to interact with Nautobot's API"
authors = ["Network to Code <opensource@networktocode.com"]
authors = ["Network to Code <opensource@networktocode.com>"]
license = "Apache 2.0"

[tool.poetry.dependencies]
Expand Down
24 changes: 24 additions & 0 deletions tests/integration/targets/latest/tasks/location.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,18 @@
description: Test Location 2 Description
location_type: "{{ child_location_type['key'] }}"
parent_location: "{{ test_create_min['location']['id'] }}"
tenant: Test Tenant
facility: EquinoxCA7
asn: "65001"
time_zone: America/Los Angeles
physical_address: Hollywood, CA, 90210
shipping_address: Hollywood, CA, 90210
latitude: "10.100000"
longitude: "12.200000"
contact_name: Jenny
contact_phone: 867-5309
contact_email: jenny@example.com
comments: "**This** is a `markdown` comment"
state: present
register: test_create_max

Expand All @@ -96,6 +108,18 @@
description: Test Location 2 Description
location_type: "{{ child_location_type['key'] }}"
parent_location: "{{ test_create_min['location']['id'] }}"
tenant: Test Tenant
facility: EquinoxCA7
asn: "65001"
time_zone: America/Los Angeles
physical_address: Hollywood, CA, 90210
shipping_address: Hollywood, CA, 90210
latitude: "10.100000"
longitude: "12.200000"
contact_name: Jenny
contact_phone: 867-5309
contact_email: jenny@example.com
comments: "**This** is a `markdown` comment"
state: present
register: test_create_max_idem

Expand Down

0 comments on commit 2a96a7e

Please sign in to comment.