fragmentedpacket / fragmentedpacket.netbox_modules / 0.1.4 / module / netbox_device_type Create, update or delete device types within Netbox | "added in version" 0.1.0 of fragmentedpacket.netbox_modules" Authors: Mikhail Yohman (@FragmentedPacket) preview | supported by communityfragmentedpacket.netbox_modules.netbox_device_type (0.1.4) — module
Install with ansible-galaxy collection install fragmentedpacket.netbox_modules:==0.1.4
collections: - name: fragmentedpacket.netbox_modules version: 0.1.4
Creates, updates or removes device types from Netbox
- name: "Test Netbox modules" connection: local hosts: localhost gather_facts: False tasks: - name: Create device type within Netbox with only required information netbox_device_type: netbox_url: http://netbox.local netbox_token: thisIsMyToken data: slug: test-device-type model: ws-test-3750 manufacturer: Test Manufacturer state: present - name: Create device type within Netbox with only required information netbox_device_type: netbox_url: http://netbox.local netbox_token: thisIsMyToken data: slug: test-device-type 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 netbox netbox_device_type: netbox_url: http://netbox.local netbox_token: thisIsMyToken data: slug: test-device-type state: absent
data: description: - Defines the device type configuration required: true suboptions: comments: description: - Comments that may include additional information in regards to the device_type custom_fields: description: - must exist in Netbox is_full_depth: description: - Whether or not the device consumes both front and rear rack faces type: bool manufacturer: description: - The manufacturer of the device type required: true model: description: - The model of the device type required: true part_number: description: - The part number of the device type slug: description: - The slug of the device type. Must follow slug formatting (URL friendly) - ex. test-device-type required: true subdevice_role: choices: - Parent - Child description: - Whether the device type is parent, child, or neither tags: description: - Any tags that the device type may need to be associated with u_height: description: - The height of the device type in rack units state: choices: - absent - present default: present description: - Use C(present) or C(absent) for adding or removing. netbox_url: description: - URL of the Netbox instance resolvable by Ansible control host required: true netbox_token: description: - The token created within Netbox to authorize API access required: true validate_certs: default: 'yes' description: - If C(no), SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates. type: bool
device_type: description: Serialized object as created or already existent within Netbox returned: success (when I(state=present)) type: dict msg: description: Message indicating failure or info about what has been achieved returned: always type: str