ansible_modules
  • Home
  • Getting Started
  • Plugins
    • Description
    • Plugin Index
      • Modules
        • netbox.netbox.netbox_aggregate module – Creates or removes aggregates from NetBox
        • netbox.netbox.netbox_asn module – Create, update or delete ASNs within NetBox
        • netbox.netbox.netbox_cable module – Create, update or delete cables within NetBox
        • netbox.netbox.netbox_circuit module – Create, update or delete circuits within NetBox
        • netbox.netbox.netbox_circuit_termination module – Create, update or delete circuit terminations within NetBox
        • netbox.netbox.netbox_circuit_type module – Create, update or delete circuit types within NetBox
        • netbox.netbox.netbox_cluster module – Create, update or delete clusters within NetBox
        • netbox.netbox.netbox_cluster_group module – Create, update or delete cluster groups within NetBox
        • netbox.netbox.netbox_cluster_type module – Create, update or delete cluster types within NetBox
        • netbox.netbox.netbox_config_context module – Creates, updates or deletes configuration contexts within NetBox
        • netbox.netbox.netbox_config_template module – Creates or removes config templates from NetBox
        • netbox.netbox.netbox_console_port module – Create, update or delete console ports within NetBox
        • netbox.netbox.netbox_console_port_template module – Create, update or delete console port templates within NetBox
        • netbox.netbox.netbox_console_server_port module – Create, update or delete console server ports within NetBox
        • netbox.netbox.netbox_console_server_port_template module – Create, update or delete console server port templates within NetBox
        • netbox.netbox.netbox_contact module – Creates or removes contacts from NetBox
        • netbox.netbox.netbox_contact_group module – Creates or removes contact groups from NetBox
        • netbox.netbox.netbox_contact_role module – Creates or removes contact roles from NetBox
        • netbox.netbox.netbox_custom_field module – Creates, updates or deletes custom fields within NetBox
        • netbox.netbox.netbox_custom_field_choice_set module – Creates, updates or deletes custom field choice sets within Netbox
        • netbox.netbox.netbox_custom_link module – Creates, updates or deletes custom links within NetBox
        • netbox.netbox.netbox_device module – Create, update or delete devices within NetBox
        • netbox.netbox.netbox_device_bay module – Create, update or delete device bays within NetBox
        • netbox.netbox.netbox_device_bay_template module – Create, update or delete device bay templates within NetBox
        • netbox.netbox.netbox_device_interface module – Creates or removes interfaces on devices from NetBox
        • netbox.netbox.netbox_device_interface_template module – Creates or removes interfaces on devices from NetBox
        • netbox.netbox.netbox_device_role module – Create, update or delete devices roles within NetBox
        • netbox.netbox.netbox_device_type module – Create, update or delete device types within NetBox
        • netbox.netbox.netbox_export_template module – Creates, updates or deletes export templates within NetBox
        • netbox.netbox.netbox_fhrp_group module – Create, update or delete FHRP groups within NetBox
        • netbox.netbox.netbox_fhrp_group_assignment module – Create, update or delete FHRP group assignments within NetBox
        • netbox.netbox.netbox_front_port module – Create, update or delete front ports within NetBox
        • netbox.netbox.netbox_front_port_template module – Create, update or delete front port templates within NetBox
        • netbox.netbox.netbox_inventory_item module – Creates or removes inventory items from NetBox
        • netbox.netbox.netbox_inventory_item_role module – Create, update or delete devices roles within NetBox
        • netbox.netbox.netbox_ip_address module – Creates or removes IP addresses from NetBox
        • netbox.netbox.netbox_ipam_role module – Creates or removes ipam roles from NetBox
        • netbox.netbox.netbox_journal_entry module – Creates a journal entry
        • netbox.netbox.netbox_l2vpn module – Create, update or delete L2VPNs within NetBox
        • netbox.netbox.netbox_l2vpn_termination module – Create, update or delete L2VPNs terminations within NetBox
        • netbox.netbox.netbox_location module – Create, update or delete locations within NetBox
        • netbox.netbox.netbox_mac_address module – Create, update or delete MAC addresses within NetBox
        • netbox.netbox.netbox_manufacturer module – Create or delete manufacturers within NetBox
        • netbox.netbox.netbox_module module – Create, update or delete module within NetBox
        • netbox.netbox.netbox_module_bay module – Create, update or delete module bay within NetBox
        • netbox.netbox.netbox_module_type module – Create, update or delete module types within NetBox
        • netbox.netbox.netbox_permission module – Creates or removes permissions from NetBox
        • netbox.netbox.netbox_platform module – Create or delete platforms within NetBox
        • netbox.netbox.netbox_power_feed module – Create, update or delete power feeds within NetBox
        • netbox.netbox.netbox_power_outlet module – Create, update or delete power outlets within NetBox
        • netbox.netbox.netbox_power_outlet_template module – Create, update or delete power outlet templates within NetBox
        • netbox.netbox.netbox_power_panel module – Create, update or delete power panels within NetBox
        • netbox.netbox.netbox_power_port module – Create, update or delete power ports within NetBox
        • netbox.netbox.netbox_power_port_template module – Create, update or delete power port templates within NetBox
        • netbox.netbox.netbox_prefix module – Creates or removes prefixes from NetBox
        • netbox.netbox.netbox_provider module – Create, update or delete providers within NetBox
        • netbox.netbox.netbox_provider_network module – Create, update or delete provider networks within NetBox
        • netbox.netbox.netbox_rack module – Create, update or delete racks within NetBox
        • netbox.netbox.netbox_rack_group module – Create, update or delete racks groups within NetBox
        • netbox.netbox.netbox_rack_role module – Create, update or delete racks roles within NetBox
        • netbox.netbox.netbox_rear_port module – Create, update or delete rear ports within NetBox
        • netbox.netbox.netbox_rear_port_template module – Create, update or delete rear port templates within NetBox
        • netbox.netbox.netbox_region module – Creates or removes regions from NetBox
        • netbox.netbox.netbox_rir module – Create, update or delete RIRs within NetBox
        • netbox.netbox.netbox_route_target module – Creates or removes route targets from NetBox
        • netbox.netbox.netbox_service module – Creates or removes service from NetBox
        • netbox.netbox.netbox_service_template module – Create, update or delete service templates within NetBox
        • netbox.netbox.netbox_site module – Creates or removes sites from NetBox
        • netbox.netbox.netbox_site_group module – Create, update, or delete site groups within NetBox
        • netbox.netbox.netbox_tag module – Creates or removes tags from NetBox
        • netbox.netbox.netbox_tenant module – Creates or removes tenants from NetBox
        • netbox.netbox.netbox_tenant_group module – Creates or removes tenant groups from NetBox
        • netbox.netbox.netbox_token module – Creates or removes tokens from NetBox
        • netbox.netbox.netbox_tunnel module – Create, update or delete tunnels within NetBox
        • netbox.netbox.netbox_tunnel_group module – Create, update or delete tunnel groups within NetBox
        • netbox.netbox.netbox_user module – Creates or removes users from NetBox
        • netbox.netbox.netbox_user_group module – Creates or removes user groups from NetBox
        • netbox.netbox.netbox_virtual_chassis module – Create, update or delete virtual chassis within NetBox
        • netbox.netbox.netbox_virtual_disk module – Creates or removes disks from virtual machines in NetBox
        • netbox.netbox.netbox_virtual_machine module – Create, update or delete virtual_machines within NetBox
        • netbox.netbox.netbox_vlan module – Create, update or delete vlans within NetBox
        • netbox.netbox.netbox_vlan_group module – Create, update or delete vlans groups within NetBox
        • netbox.netbox.netbox_vm_interface module – Creates or removes interfaces from virtual machines in NetBox
        • netbox.netbox.netbox_vrf module – Create, update or delete vrfs within NetBox
        • netbox.netbox.netbox_webhook module – Creates, updates or deletes webhook configuration within NetBox
        • netbox.netbox.netbox_wireless_lan module – Creates or removes Wireless LANs from NetBox
        • netbox.netbox.netbox_wireless_lan_group module – Creates or removes Wireless LAN Groups from NetBox
        • netbox.netbox.netbox_wireless_link module – Creates or removes Wireless links from NetBox
      • Inventory Plugins
      • Lookup Plugins
  • Module Utils (Python) Docs
  • Changelog
ansible_modules
  • Netbox.Netbox
  • netbox.netbox.netbox_custom_link module – Creates, updates or deletes custom links within NetBox
  • View page source

netbox.netbox.netbox_custom_link module – Creates, updates or deletes custom links within NetBox

Note

This module is part of the netbox.netbox collection (version 3.21.0).

It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install netbox.netbox. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: netbox.netbox.netbox_custom_link.

New in netbox.netbox 3.6.0

  • Synopsis

  • Requirements

  • Parameters

  • Notes

  • Examples

  • Return Values

Synopsis

  • Creates, updates or removes custom links from NetBox

Requirements

The below requirements are needed on the host that executes this module.

  • pynetbox

Parameters

Parameter

Comments

cert

Certificate path

data

Defines the custom field

button_class

Button class for the custom link

content_type

The content type to apply this custom link to

content_types

:ansible-option-versionadded:`added in netbox.netbox 3.10.0`

The content type to apply this custom link to (NetBox 3.4+)

enabled

:ansible-option-versionadded:`added in netbox.netbox 3.7.0`

Enable/disable custom link

:ansible-option-choices:`Choices:`

  • :ansible-option-choices-entry:`false`

  • :ansible-option-choices-entry:`true`

group_name

The group to associate the custom link with

link_text

Link text of the custom link

link_url

Link URL of the custom link

name

The name of the custom link

new_window

Open link in new window

:ansible-option-choices:`Choices:`

  • :ansible-option-choices-entry:`false`

  • :ansible-option-choices-entry:`true`

object_types

:ansible-option-versionadded:`added in netbox.netbox 3.19.0`

The object type(s) to apply this custom link to (NetBox 4.0+)

weight

Fields with higher weights appear lower in a form

netbox_token

The NetBox API token.

netbox_url

The URL of the NetBox instance.

Must be accessible by the Ansible control host.

query_params

This can be used to override the specified values in ALLOWED_QUERY_PARAMS that are defined

in plugins/module_utils/netbox_utils.py and provides control to users on what may make

an object unique in their environment.

state

The state of the object.

:ansible-option-choices:`Choices:`

  • :ansible-option-choices-entry-default:`"present"` :ansible-option-choices-default-mark:`← (default)`

  • :ansible-option-choices-entry:`"absent"`

validate_certs

If no, SSL certificates will not be validated.

This should only be used on personally controlled sites using a self-signed certificates.

:ansible-option-default-bold:`Default:` :ansible-option-default:`true`

Notes

Note

  • This should be ran with connection local and hosts localhost

  • Use the !unsafe data type if you want jinja2 code in link_text or link_url

Examples

- name: "Test NetBox custom_link module"
  connection: local
  hosts: localhost
  tasks:
    - name: Create a custom link on device
      netbox.netbox.netbox_custom_link:
        netbox_url: http://netbox.local
        netbox_token: thisIsMyToken
        data:
          content_type: "dcim.device"
          name: Custom Link
          link_text: "Open Web Management"
          link_url: !unsafe https://{{ obj.name }}.domain.local

    - name: Delete the custom link
      netbox.netbox.netbox_custom_link:
        netbox_url: http://netbox.local
        netbox_token: thisIsMyToken
        data:
          content_type: "dcim.device"
          name: Custom Link
          link_text: "Open Web Management"
          link_url: !unsafe https://{{ obj.name }}.domain.local
        state: absent

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

custom_link

Serialized object as created/existent/updated/deleted within NetBox

:ansible-option-returned-bold:`Returned:` always

msg

Message indicating failure or info about what has been achieved

:ansible-option-returned-bold:`Returned:` always

Authors

  • Martin Rødvand (@rodvand)

Collection links

Previous Next

© Copyright 2020, Mikhail Yohman.

Built with Sphinx using a theme provided by Read the Docs.