networktocode.nautobot.location_type (5.1.1) — module

Creates or removes location types from Nautobot

| "added in version" 4.3.0 of networktocode.nautobot"

Authors: Joe Wesch (@joewesch)

Install collection

Install with ansible-galaxy collection install networktocode.nautobot:==5.1.1


Add to requirements.yml

  collections:
    - name: networktocode.nautobot
      version: 5.1.1

Description

Creates or removes location types from Nautobot


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: "Test Nautobot location type module"
  connection: local
  hosts: localhost
  gather_facts: False
  tasks:
    - name: Create location type
      networktocode.nautobot.location_type:
        url: http://nautobot.local
        token: thisIsMyToken
        name: My Location Type
        state: present

    - name: Delete location type
      networktocode.nautobot.location_type:
        url: http://nautobot.local
        token: thisIsMyToken
        name: My Location Type
        state: absent

    - name: Create location type with all parameters
      networktocode.nautobot.location_type:
        url: http://nautobot.local
        token: thisIsMyToken
        name: My Nested Location Type
        description: My Nested Location Type Description
        parent:
          name: My Location Type
        nestable: false
        content_types:
          - "dcim.device"
        state: present

Inputs

    
url:
    description:
    - 'The URL of the Nautobot instance resolvable by the Ansible host (for example: http://nautobot.example.com:8000)'
    required: true
    type: str

name:
    description:
    - Name of the location type to be created
    required: true
    type: str

state:
    choices:
    - absent
    - present
    default: present
    description:
    - Use C(present) or C(absent) for adding or removing.
    type: str

token:
    description:
    - The token created within Nautobot to authorize API access
    required: true
    type: str

parent:
    description:
    - The parent location type this location type should be tied to
    required: false
    type: raw

nestable:
    description:
    - Allow Locations of this type to be parents/children of other Locations of this same
      type
    - Requires C(nautobot >= 1.5)
    type: bool

api_version:
    description:
    - API Version Nautobot REST API
    required: false
    type: str
    version_added: 4.1.0
    version_added_collection: networktocode.nautobot

description:
    description:
    - Location Type description
    required: false
    type: str

query_params:
    description:
    - This can be used to override the specified values in ALLOWED_QUERY_PARAMS that is
      defined
    - in plugins/module_utils/utils.py and provides control to users on what may make
    - an object unique in their environment.
    elements: str
    required: false
    type: list
    version_added: 3.0.0
    version_added_collection: networktocode.nautobot

content_types:
    description:
    - Location Type content type(s). These match app.endpoint and the endpoint is singular.
    - e.g. dcim.device, ipam.ipaddress (more can be found in the examples)
    elements: str
    required: false
    type: list

custom_fields:
    description:
    - Must exist in Nautobot and in key/value format
    required: false
    type: dict
    version_added: 3.0.0
    version_added_collection: networktocode.nautobot

validate_certs:
    default: true
    description:
    - If C(no), SSL certificates will not be validated. This should only be used on personally
      controlled sites using self-signed certificates.
    required: false
    type: raw

Outputs

location_type:
  description: Serialized object as created or already existent within Nautobot
  returned: on creation
  type: dict
msg:
  description: Message indicating failure or info about what has been achieved
  returned: always
  type: str