networktocode.nautobot.device_type (5.1.1) — module

Create, update or delete device types within Nautobot

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

Authors: Mikhail Yohman (@FragmentedPacket)

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, updates or removes device types from Nautobot


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: "Test Nautobot modules"
  connection: local
  hosts: localhost
  gather_facts: False

  tasks:
    - name: Create device type within Nautobot with only required information
      networktocode.nautobot.device_type:
        url: http://nautobot.local
        token: thisIsMyToken
        model: ws-test-3750
        manufacturer: Test Manufacturer
        state: present

    - name: Create device type within Nautobot with only required information
      networktocode.nautobot.device_type:
        url: http://nautobot.local
        token: thisIsMyToken
        model: ws-test-3750
        manufacturer: Test Manufacturer
        part_number: ws-3750g-v2
        u_height: 1
        is_full_depth: False
        subdevice_role: parent
        state: present

    - name: Delete device type within nautobot
      networktocode.nautobot.device_type:
        url: http://nautobot.local
        token: thisIsMyToken
        model: ws-test-3750
        state: absent

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

tags:
    description:
    - Any tags that this item may need to be associated with
    elements: raw
    required: false
    type: list
    version_added: 3.0.0
    version_added_collection: networktocode.nautobot

model:
    description:
    - The model of the device type
    required: true
    type: raw
    version_added: 3.0.0
    version_added_collection: networktocode.nautobot

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

comments:
    description:
    - Comments that may include additional information in regards to the device_type
    required: false
    type: str
    version_added: 3.0.0
    version_added_collection: networktocode.nautobot

u_height:
    description:
    - The height of the device type in rack units
    required: false
    type: int
    version_added: 3.0.0
    version_added_collection: networktocode.nautobot

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

part_number:
    description:
    - The part number of the device type
    required: false
    type: str
    version_added: 3.0.0
    version_added_collection: networktocode.nautobot

manufacturer:
    description:
    - The manufacturer of the device type
    required: false
    type: raw
    version_added: 3.0.0
    version_added_collection: networktocode.nautobot

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

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

is_full_depth:
    description:
    - Whether or not the device consumes both front and rear rack faces
    required: false
    type: bool
    version_added: 3.0.0
    version_added_collection: networktocode.nautobot

subdevice_role:
    choices:
    - Parent
    - parent
    - Child
    - child
    description:
    - Whether the device type is parent, child, or neither
    required: false
    type: str
    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

device_type:
  description: Serialized object as created or already existent within Nautobot
  returned: success (when I(state=present))
  type: dict
msg:
  description: Message indicating failure or info about what has been achieved
  returned: always
  type: str