ansible-collections/cisco.nxos

Could we get an nxos_interfaces_global module?

LewisR07 opened this issue · 2 comments

SUMMARY

Is it possible to get an nxos_interfaces_global module like we have for ntp, bgp etc.

It is alot of lines of config to have one module to enable the interface, set MTU and the description, then another todo layer3/layer2 things?

Not sure if its also worth combining the other interface modules (vpc, lacp, hsrp etc.)

Thanks

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

nxos_interfaces module
nxos_l2_interfaces module
nxos_l3_interfaces module

ADDITIONAL INFORMATION

Simplifies the configuration files.

- name: Setup interfaces
  cisco.nxos.nxos_interfaces_global:
    config:
    - name: Ethernet1/1
      description: Super Simple L3 Interface configuration
      enabled: true
      mode: access
      vlan: 2501
      ipv4:
        - address: 192.168.25.3/24
    - name: Ethernet1/2
      description: Super Simple Trunk Interface configuration
      enabled: true
      mode: trunk
      allowed_vlans: 2501,2500,1000,888
    state: replaced

Hey @LewisR07 resource modules are specific to resources like interface/ l2_interface/ acls and others, they are supposed to be distinct modules to enhance flexibility while dealing with a large configuration.

The resource modules having _global at the end are not intended to conjugate multiple resource modules into one, rather older modules like logging/ ntp have been named logging_global or ntp_global for identification sake.
One can use multiple resource modules in subsequent tasks which serve the same purpose as the ask here.

Moreover, you can definitely check out some Ansible content like network.interface which enabled the use of all interface modules combined.

Regards

Hi @KB-perByte that makes sense. thank you for suggesting that collection which I will take a look at.

Kind Regards,

Lewis.