ansible-collections / cisco.nxos

Ansible Network Collection for Cisco NXOS
GNU General Public License v3.0
116 stars 109 forks source link

Utilize the cisco.nxos.nxos_bgp_global module to create bgp peer-template and apply/inherit the peer-template to bgp neighbors in default and vrf contexts #606

Closed digitalfiend64 closed 1 year ago

digitalfiend64 commented 1 year ago

SUMMARY

Utilize the cisco.nxos.nxos_bgp_global module to create bgp peer-template and apply/inherit the peer-template to bgp neighbors in default and vrf contexts.

ISSUE TYPE
COMPONENT NAME

cisco.nxos.nxos_bgp_global

ADDITIONAL INFORMATION

This would help us avoid adding static templates for neighbor-group configurations and achieve comprehensive bgp configuration within the same module.


router bgp {{ template['as_number'] }}
{% for neighbor in template['neighbors'] %}
{% if 'vrf' in neighbor %}
vrf {{ neighbor['vrf'] }}
{% endif %}
neighbor {{ neighbor['neighbor_address'] }}
  use neighbor-group {{ neighbor['neighbor_group'] }}
{% endfor %}
digitalfiend64 commented 1 year ago

My customer has inquired about the status of this issue. Is there any news or timeframe I can provide back to them?

NilashishC commented 1 year ago

@digitalfiend64 We are exploring the best possible way to deal with creation of neighbor templates. However, the ability to use an already existing peer template is current present in the module. As an example,

- name: Apply peer-template to BGP neighbor 
  cisco.nxos.nxos_bgp_global:
    config:
      as_number: 65535
      neighbors:
        - neighbor_address: 192.168.1.100 
          description: NBR-1
           inherit:
             peer: nbr_templt
          remote_as: 65563