netbox.netbox.netbox_route_target – Creates or removes route targets from Netbox¶
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
.
New in version 2.0.0: of netbox.netbox
Parameters¶
Notes¶
Note
Tags should be defined as a YAML list
This should be ran with connection
local
and hostslocalhost
Examples¶
- 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"
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Authors¶
Mikhail Yohman (@fragmentedpacket)