network-engine icon indicating copy to clipboard operation
network-engine copied to clipboard

Short name interface_split function

Open ryanmerolle opened this issue 6 years ago • 0 comments

ISSUE TYPE

  • Feature Idea

ANSIBLE VERSION

ansible 2.9.0
  config file = None
  configured module search path = ['/home/user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/user/.local/lib/python3.6/site-packages/ansible
  executable location = /home/user/.local/bin/ansible
  python version = 3.6.8 (default, Oct  7 2019, 12:59:55) [GCC 8.3.0]

ansible-network.network-engine, v2.7.5

Network OS

All

SUMMARY

Nearly all Network OS report a short name for interfaces. It would be useful for interface_split or a similar filter to spit such short names out given a full interface name.

EXPECTED RESULTS

{{ 'Ethernet1/1' | interface_split('shortname') }} returns 'Et1/1' {{ 'Loopback0' | interface_split('shortname') }} returns 'Lo0' {{ 'TenGigabitEthernet1/0/1' | interface_split('shortname') }} returns 'Te1/0/1' {{ 'Tunnel1' | interface_split('shortname') }} returns 'Tu1'

ryanmerolle avatar Nov 07 '19 21:11 ryanmerolle