Description
SUMMARY
In RouterOS at /interface ethernet print detail
we can get data about the transmission standard in the advertise=
field.
For example: advertise=10M-baseT-half,10M-baseT-full,100M-baseT-half,100M-baseT-full,1G-baseT-half,1G-baseT-full,1G-baseX,2.5G-baseT,2.5G-baseX,5G-baseT,10G-baseT,10G-baseSR-LR,10G-baseCR
This information is not available in the api_facts
module.
ISSUE TYPE
- Feature Idea
COMPONENT NAME
api_facts
ADDITIONAL INFORMATION
It would be useful to backfill a source of truth with facts from the device. Netbox for example requires the type of interface to be specified and while I can think of a solution to do that for SFP interfaces, RJ45 interfaces in MikroTik are always called etherX, so determining the exact speed is not possible.
Would be useful to get this info without additional scripting :)
tasks:
- name: Collect facts
community.routeros.api_facts:
<<: *credentials
gather_subset: all
- name: Netbox | Create interfaces
loop: "{{ ansible_net_interfaces | dict2items }}"
netbox.netbox.netbox_device_interface:
<<: *netbox_credentials
data:
name: "{{ item.key }}"
mac_address: "{{ item.value['mac-address'] }}"
device: "{{ inventory_hostname }}"
mtu: "{{ item.value.mtu }}"
type: "{{ item.value.advertise | # some extra filtering required, but doable }}" # note this line