orphan: |
---|
Note
This plugin is part of the netbox.netbox collection (version 2.0.0).
To install it use: ansible-galaxy collection install netbox.netbox
.
To use it in a playbook, specify: netbox.netbox.netbox_route_target
.
.. versionadded:: 2.0.0 of netbox.netbox
- Creates or removes route targets from Netbox
The below requirements are needed on the host that executes this module.
- pynetbox
Note
- Tags should be defined as a YAML list
- This should be ran with connection
local
and hostslocalhost
- name: "Test route target creation/deletion"
connection: local
hosts: localhost
gather_facts: False
tasks:
- name: Create Route Targets
netbox.netbox.netbox_route_target:
netbox_url: http://netbox.local
netbox_token: thisIsMyToken
data:
name: "{{ item.name }}"
tenant: "Test Tenant"
tags:
- Schnozzberry
loop:
- { name: "65000:65001", description: "management" }
- { name: "65000:65002", description: "tunnel" }
- name: Update Description on Route Targets
netbox.netbox.netbox_route_target:
netbox_url: http://netbox.local
netbox_token: thisIsMyToken
data:
name: "{{ item.name }}"
tenant: "Test Tenant"
description: "{{ item.description }}"
tags:
- Schnozzberry
loop:
- { name: "65000:65001", description: "management" }
- { name: "65000:65002", description: "tunnel" }
- name: Delete Route Targets
netbox.netbox.netbox_route_target:
netbox_url: http://netbox.local
netbox_token: thisIsMyToken
data:
name: "{{ item }}"
state: absent
loop:
- "65000:65001"
- "65000:65002"
Common return values are documented :ref:`here <common_return_values>`, the following are the fields unique to this module:
- Mikhail Yohman (@fragmentedpacket)