netbox.netbox.netbox_service – Creates or removes service from Netbox¶
Note
This plugin is part of the netbox.netbox collection (version 3.1.0).
To install it use: ansible-galaxy collection install netbox.netbox
.
To use it in a playbook, specify: netbox.netbox.netbox_service
.
New in version 0.1.5: of netbox.netbox
Synopsis¶
Creates or removes service from Netbox
Requirements¶
The below requirements are needed on the host that executes this module.
pynetbox
Parameters¶
Notes¶
Note
This should be ran with connection
local
and hostslocalhost
Examples¶
- name: "Create netbox service"
connection: local
hosts: all
gather_facts: False
tasks:
- name: Create service
netbox_service:
netbox_url: netbox_url
netbox_token: netbox_token
data:
device: Test666
name: node-exporter
port: 9100
protocol: TCP
ipaddresses:
- address: 127.0.0.1
tags:
- prometheus
state: present
- name: "Delete netbox service"
connection: local
hosts: all
gather_facts: False
tasks:
- name: Delete service
netbox_service:
netbox_url: netbox_url
netbox_token: netbox_token
data:
device: Test666
name: node-exporter
port: 9100
protocol: TCP
state: absent