PR to fix ios bgp TC failure (#58010)
* fix ios bgp tc failure Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com> * skip test with 15.6(T)2 ios Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com> * skip test with 15.6(T)2 ios Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>
This commit is contained in:
parent
2b5ad94a96
commit
77b6255305
1 changed files with 337 additions and 328 deletions
|
@ -5,390 +5,399 @@
|
||||||
operation: delete
|
operation: delete
|
||||||
ignore_errors: yes
|
ignore_errors: yes
|
||||||
|
|
||||||
- name: Configure BGP with AS 64496 and a router-id
|
- block:
|
||||||
ios_bgp: &config
|
|
||||||
operation: merge
|
|
||||||
config:
|
|
||||||
bgp_as: 64496
|
|
||||||
router_id: 192.0.2.2
|
|
||||||
register: result
|
|
||||||
|
|
||||||
- assert:
|
- name: Configure BGP with AS 64496 and a router-id
|
||||||
that:
|
ios_bgp: &config
|
||||||
- 'result.changed == true'
|
operation: merge
|
||||||
- "'router bgp 64496' in result.commands"
|
config:
|
||||||
- "'bgp router-id 192.0.2.2' in result.commands"
|
bgp_as: 64496
|
||||||
|
router_id: 192.0.2.2
|
||||||
|
register: result
|
||||||
|
|
||||||
- name: Configure BGP with AS 64496 and a router-id (idempotent)
|
- assert:
|
||||||
ios_bgp: *config
|
that:
|
||||||
register: result
|
- 'result.changed == true'
|
||||||
|
- "'router bgp 64496' in result.commands"
|
||||||
|
- "'bgp router-id 192.0.2.2' in result.commands"
|
||||||
|
|
||||||
- assert:
|
- name: Configure BGP with AS 64496 and a router-id (idempotent)
|
||||||
that:
|
ios_bgp: *config
|
||||||
- 'result.changed == false'
|
register: result
|
||||||
|
|
||||||
- name: Configure BGP neighbors
|
- assert:
|
||||||
ios_bgp: &nbr
|
that:
|
||||||
operation: merge
|
- 'result.changed == false'
|
||||||
config:
|
|
||||||
bgp_as: 64496
|
|
||||||
neighbors:
|
|
||||||
- neighbor: 192.0.2.10
|
|
||||||
remote_as: 64496
|
|
||||||
password: ansible
|
|
||||||
description: IBGP_NBR_1
|
|
||||||
ebgp_multihop: 100
|
|
||||||
timers:
|
|
||||||
keepalive: 300
|
|
||||||
holdtime: 360
|
|
||||||
min_neighbor_holdtime: 360
|
|
||||||
|
|
||||||
- neighbor: 192.0.2.15
|
- name: Configure BGP neighbors
|
||||||
remote_as: 64496
|
ios_bgp: &nbr
|
||||||
description: IBGP_NBR_2
|
operation: merge
|
||||||
ebgp_multihop: 150
|
config:
|
||||||
register: result
|
bgp_as: 64496
|
||||||
|
neighbors:
|
||||||
|
- neighbor: 192.0.2.10
|
||||||
|
remote_as: 64496
|
||||||
|
password: ansible
|
||||||
|
description: IBGP_NBR_1
|
||||||
|
ebgp_multihop: 100
|
||||||
|
timers:
|
||||||
|
keepalive: 300
|
||||||
|
holdtime: 360
|
||||||
|
min_neighbor_holdtime: 360
|
||||||
|
|
||||||
- assert:
|
- neighbor: 192.0.2.15
|
||||||
that:
|
remote_as: 64496
|
||||||
- 'result.changed == true'
|
description: IBGP_NBR_2
|
||||||
- "'router bgp 64496' in result.commands"
|
ebgp_multihop: 150
|
||||||
- "'neighbor 192.0.2.10 remote-as 64496' in result.commands"
|
register: result
|
||||||
- "'neighbor 192.0.2.10 description IBGP_NBR_1' in result.commands"
|
|
||||||
- "'neighbor 192.0.2.10 ebgp-multihop 100' in result.commands"
|
|
||||||
- "'neighbor 192.0.2.10 timers 300 360 360' in result.commands"
|
|
||||||
- "'neighbor 192.0.2.15 remote-as 64496' in result.commands"
|
|
||||||
- "'neighbor 192.0.2.15 description IBGP_NBR_2' in result.commands"
|
|
||||||
- "'neighbor 192.0.2.15 ebgp-multihop 150' in result.commands"
|
|
||||||
|
|
||||||
- name: Configure BGP neighbors (idempotent)
|
- assert:
|
||||||
ios_bgp: *nbr
|
that:
|
||||||
register: result
|
- 'result.changed == true'
|
||||||
|
- "'router bgp 64496' in result.commands"
|
||||||
|
- "'neighbor 192.0.2.10 remote-as 64496' in result.commands"
|
||||||
|
- "'neighbor 192.0.2.10 description IBGP_NBR_1' in result.commands"
|
||||||
|
- "'neighbor 192.0.2.10 ebgp-multihop 100' in result.commands"
|
||||||
|
- "'neighbor 192.0.2.10 timers 300 360 360' in result.commands"
|
||||||
|
- "'neighbor 192.0.2.15 remote-as 64496' in result.commands"
|
||||||
|
- "'neighbor 192.0.2.15 description IBGP_NBR_2' in result.commands"
|
||||||
|
- "'neighbor 192.0.2.15 ebgp-multihop 150' in result.commands"
|
||||||
|
|
||||||
- assert:
|
- name: Configure BGP neighbors (idempotent)
|
||||||
that:
|
ios_bgp: *nbr
|
||||||
- 'result.changed == false'
|
register: result
|
||||||
|
|
||||||
- name: Configure BGP neighbors with operation replace
|
- assert:
|
||||||
ios_bgp: &nbr_rplc
|
that:
|
||||||
operation: replace
|
- 'result.changed == false'
|
||||||
config:
|
|
||||||
bgp_as: 64496
|
|
||||||
neighbors:
|
|
||||||
- neighbor: 192.0.2.15
|
|
||||||
remote_as: 64496
|
|
||||||
description: IBGP_NBR_2
|
|
||||||
ebgp_multihop: 150
|
|
||||||
|
|
||||||
- neighbor: 203.0.113.10
|
- name: Configure BGP neighbors with operation replace
|
||||||
remote_as: 64511
|
ios_bgp: &nbr_rplc
|
||||||
description: EBGP_NBR_1
|
operation: replace
|
||||||
local_as: 64497
|
config:
|
||||||
register: result
|
bgp_as: 64496
|
||||||
|
neighbors:
|
||||||
|
- neighbor: 192.0.2.15
|
||||||
|
remote_as: 64496
|
||||||
|
description: IBGP_NBR_2
|
||||||
|
ebgp_multihop: 150
|
||||||
|
|
||||||
- assert:
|
- neighbor: 203.0.113.10
|
||||||
that:
|
remote_as: 64511
|
||||||
- 'result.changed == true'
|
description: EBGP_NBR_1
|
||||||
- "'neighbor 203.0.113.10 remote-as 64511' in result.commands"
|
local_as: 64497
|
||||||
- "'neighbor 203.0.113.10 description EBGP_NBR_1' in result.commands"
|
register: result
|
||||||
- "'neighbor 203.0.113.10 local-as 64497' in result.commands"
|
|
||||||
- "'no neighbor 192.0.2.10' in result.commands"
|
|
||||||
|
|
||||||
- name: Configure BGP neighbors with operation replace (idempotent)
|
- assert:
|
||||||
ios_bgp: *nbr_rplc
|
that:
|
||||||
register: result
|
- 'result.changed == true'
|
||||||
|
- "'neighbor 203.0.113.10 remote-as 64511' in result.commands"
|
||||||
|
- "'neighbor 203.0.113.10 description EBGP_NBR_1' in result.commands"
|
||||||
|
- "'neighbor 203.0.113.10 local-as 64497' in result.commands"
|
||||||
|
- "'no neighbor 192.0.2.10' in result.commands"
|
||||||
|
|
||||||
- assert:
|
- name: Configure BGP neighbors with operation replace (idempotent)
|
||||||
that:
|
ios_bgp: *nbr_rplc
|
||||||
- 'result.changed == false'
|
register: result
|
||||||
|
|
||||||
- name: Configure root-level networks for BGP
|
- assert:
|
||||||
ios_bgp: &net
|
that:
|
||||||
operation: merge
|
- 'result.changed == false'
|
||||||
config:
|
|
||||||
bgp_as: 64496
|
|
||||||
networks:
|
|
||||||
- prefix: 203.0.113.0
|
|
||||||
masklen: 27
|
|
||||||
route_map: RMAP_1
|
|
||||||
|
|
||||||
- prefix: 203.0.113.32
|
- name: Configure root-level networks for BGP
|
||||||
masklen: 27
|
ios_bgp: &net
|
||||||
route_map: RMAP_2
|
operation: merge
|
||||||
register: result
|
config:
|
||||||
|
bgp_as: 64496
|
||||||
|
networks:
|
||||||
|
- prefix: 203.0.113.0
|
||||||
|
masklen: 27
|
||||||
|
route_map: RMAP_1
|
||||||
|
|
||||||
- assert:
|
- prefix: 203.0.113.32
|
||||||
that:
|
masklen: 27
|
||||||
- 'result.changed == True'
|
route_map: RMAP_2
|
||||||
- "'router bgp 64496' in result.commands"
|
register: result
|
||||||
- "'network 203.0.113.0 mask 255.255.255.224 route-map RMAP_1' in result.commands"
|
|
||||||
- "'network 203.0.113.32 mask 255.255.255.224 route-map RMAP_2' in result.commands"
|
|
||||||
|
|
||||||
- name: Configure root-level networks for BGP (idempotent)
|
- assert:
|
||||||
ios_bgp: *net
|
that:
|
||||||
register: result
|
- 'result.changed == True'
|
||||||
|
- "'router bgp 64496' in result.commands"
|
||||||
|
- "'network 203.0.113.0 mask 255.255.255.224 route-map RMAP_1' in result.commands"
|
||||||
|
- "'network 203.0.113.32 mask 255.255.255.224 route-map RMAP_2' in result.commands"
|
||||||
|
|
||||||
- assert:
|
- name: Configure root-level networks for BGP (idempotent)
|
||||||
that:
|
ios_bgp: *net
|
||||||
- 'result.changed == false'
|
register: result
|
||||||
|
|
||||||
- name: Configure root-level networks for BGP with operation replace
|
- assert:
|
||||||
ios_bgp: &net_rplc
|
that:
|
||||||
operation: replace
|
- 'result.changed == false'
|
||||||
config:
|
|
||||||
bgp_as: 64496
|
|
||||||
networks:
|
|
||||||
- prefix: 203.0.113.0
|
|
||||||
masklen: 27
|
|
||||||
route_map: RMAP_1
|
|
||||||
|
|
||||||
- prefix: 198.51.100.16
|
- name: Configure root-level networks for BGP with operation replace
|
||||||
masklen: 28
|
ios_bgp: &net_rplc
|
||||||
register: result
|
operation: replace
|
||||||
|
config:
|
||||||
|
bgp_as: 64496
|
||||||
|
networks:
|
||||||
|
- prefix: 203.0.113.0
|
||||||
|
masklen: 27
|
||||||
|
route_map: RMAP_1
|
||||||
|
|
||||||
- assert:
|
- prefix: 198.51.100.16
|
||||||
that:
|
masklen: 28
|
||||||
- 'result.changed == True'
|
register: result
|
||||||
- "'router bgp 64496' in result.commands"
|
|
||||||
- "'network 198.51.100.16 mask 255.255.255.240' in result.commands"
|
|
||||||
- "'no network 203.0.113.32 mask 255.255.255.224 route-map RMAP_2' in result.commands"
|
|
||||||
|
|
||||||
- name: Configure root-level networks for BGP with operation replace (idempotent)
|
- assert:
|
||||||
ios_bgp: *net_rplc
|
that:
|
||||||
register: result
|
- 'result.changed == True'
|
||||||
|
- "'router bgp 64496' in result.commands"
|
||||||
|
- "'network 198.51.100.16 mask 255.255.255.240' in result.commands"
|
||||||
|
- "'no network 203.0.113.32 mask 255.255.255.224 route-map RMAP_2' in result.commands"
|
||||||
|
|
||||||
- assert:
|
- name: Configure root-level networks for BGP with operation replace (idempotent)
|
||||||
that:
|
ios_bgp: *net_rplc
|
||||||
- 'result.changed == false'
|
register: result
|
||||||
|
|
||||||
- name: Configure BGP neighbors under address family mode
|
- assert:
|
||||||
ios_bgp: &af_nbr
|
that:
|
||||||
operation: merge
|
- 'result.changed == false'
|
||||||
config:
|
|
||||||
bgp_as: 64496
|
|
||||||
address_family:
|
|
||||||
- afi: ipv4
|
|
||||||
safi: unicast
|
|
||||||
neighbors:
|
|
||||||
- neighbor: 203.0.113.10
|
|
||||||
activate: yes
|
|
||||||
maximum_prefix: 250
|
|
||||||
advertisement_interval: 120
|
|
||||||
|
|
||||||
- neighbor: 192.0.2.15
|
- name: Configure BGP neighbors under address family mode
|
||||||
activate: yes
|
ios_bgp: &af_nbr
|
||||||
route_reflector_client: True
|
operation: merge
|
||||||
register: result
|
config:
|
||||||
|
bgp_as: 64496
|
||||||
|
address_family:
|
||||||
|
- afi: ipv4
|
||||||
|
safi: unicast
|
||||||
|
neighbors:
|
||||||
|
- neighbor: 203.0.113.10
|
||||||
|
activate: yes
|
||||||
|
maximum_prefix: 250
|
||||||
|
advertisement_interval: 120
|
||||||
|
|
||||||
- assert:
|
- neighbor: 192.0.2.15
|
||||||
that:
|
activate: yes
|
||||||
- 'result.changed == true'
|
route_reflector_client: True
|
||||||
- "'router bgp 64496' in result.commands"
|
register: result
|
||||||
- "'address-family ipv4' in result.commands"
|
|
||||||
- "'neighbor 203.0.113.10 activate' in result.commands"
|
|
||||||
- "'neighbor 203.0.113.10 maximum-prefix 250' in result.commands"
|
|
||||||
- "'neighbor 203.0.113.10 advertisement-interval 120' in result.commands"
|
|
||||||
- "'neighbor 192.0.2.15 activate' in result.commands"
|
|
||||||
- "'neighbor 192.0.2.15 route-reflector-client' in result.commands"
|
|
||||||
|
|
||||||
- name: Configure BGP neighbors under address family mode (idempotent)
|
- assert:
|
||||||
ios_bgp: *af_nbr
|
that:
|
||||||
register: result
|
- 'result.changed == true'
|
||||||
|
- "'router bgp 64496' in result.commands"
|
||||||
|
- "'address-family ipv4' in result.commands"
|
||||||
|
- "'neighbor 203.0.113.10 activate' in result.commands"
|
||||||
|
- "'neighbor 203.0.113.10 maximum-prefix 250' in result.commands"
|
||||||
|
- "'neighbor 203.0.113.10 advertisement-interval 120' in result.commands"
|
||||||
|
- "'neighbor 192.0.2.15 activate' in result.commands"
|
||||||
|
- "'neighbor 192.0.2.15 route-reflector-client' in result.commands"
|
||||||
|
|
||||||
- assert:
|
- name: Configure BGP neighbors under address family mode (idempotent)
|
||||||
that:
|
ios_bgp: *af_nbr
|
||||||
- 'result.changed == false'
|
register: result
|
||||||
|
|
||||||
- name: Configure networks under address family
|
- assert:
|
||||||
ios_bgp: &af_net
|
that:
|
||||||
operation: merge
|
- 'result.changed == false'
|
||||||
config:
|
|
||||||
bgp_as: 64496
|
|
||||||
address_family:
|
|
||||||
- afi: ipv4
|
|
||||||
safi: multicast
|
|
||||||
networks:
|
|
||||||
- prefix: 198.51.100.48
|
|
||||||
masklen: 28
|
|
||||||
route_map: RMAP_1
|
|
||||||
|
|
||||||
- prefix: 192.0.2.64
|
- name: Configure networks under address family
|
||||||
masklen: 27
|
ios_bgp: &af_net
|
||||||
|
operation: merge
|
||||||
|
config:
|
||||||
|
bgp_as: 64496
|
||||||
|
address_family:
|
||||||
|
- afi: ipv4
|
||||||
|
safi: multicast
|
||||||
|
networks:
|
||||||
|
- prefix: 198.51.100.48
|
||||||
|
masklen: 28
|
||||||
|
route_map: RMAP_1
|
||||||
|
|
||||||
- prefix: 203.0.113.160
|
- prefix: 192.0.2.64
|
||||||
masklen: 27
|
masklen: 27
|
||||||
route_map: RMAP_2
|
|
||||||
|
|
||||||
- afi: ipv4
|
- prefix: 203.0.113.160
|
||||||
safi: unicast
|
masklen: 27
|
||||||
networks:
|
route_map: RMAP_2
|
||||||
- prefix: 198.51.100.64
|
|
||||||
masklen: 28
|
|
||||||
register: result
|
|
||||||
|
|
||||||
- assert:
|
- afi: ipv4
|
||||||
that:
|
safi: unicast
|
||||||
- 'result.changed == true'
|
networks:
|
||||||
- "'router bgp 64496' in result.commands"
|
- prefix: 198.51.100.64
|
||||||
- "'address-family ipv4 multicast' in result.commands"
|
masklen: 28
|
||||||
- "'network 198.51.100.48 mask 255.255.255.240 route-map RMAP_1' in result.commands"
|
register: result
|
||||||
- "'network 192.0.2.64 mask 255.255.255.224' in result.commands"
|
|
||||||
- "'network 203.0.113.160 mask 255.255.255.224 route-map RMAP_2' in result.commands"
|
|
||||||
- "'exit-address-family' in result.commands"
|
|
||||||
- "'address-family ipv4' in result.commands"
|
|
||||||
- "'network 198.51.100.64 mask 255.255.255.240' in result.commands"
|
|
||||||
- "'exit-address-family' in result.commands"
|
|
||||||
|
|
||||||
- name: Configure networks under address family (idempotent)
|
- assert:
|
||||||
ios_bgp: *af_net
|
that:
|
||||||
register: result
|
- 'result.changed == true'
|
||||||
|
- "'router bgp 64496' in result.commands"
|
||||||
|
- "'address-family ipv4 multicast' in result.commands"
|
||||||
|
- "'network 198.51.100.48 mask 255.255.255.240 route-map RMAP_1' in result.commands"
|
||||||
|
- "'network 192.0.2.64 mask 255.255.255.224' in result.commands"
|
||||||
|
- "'network 203.0.113.160 mask 255.255.255.224 route-map RMAP_2' in result.commands"
|
||||||
|
- "'exit-address-family' in result.commands"
|
||||||
|
- "'address-family ipv4' in result.commands"
|
||||||
|
- "'network 198.51.100.64 mask 255.255.255.240' in result.commands"
|
||||||
|
- "'exit-address-family' in result.commands"
|
||||||
|
|
||||||
- assert:
|
- name: Configure networks under address family (idempotent)
|
||||||
that:
|
ios_bgp: *af_net
|
||||||
- 'result.changed == false'
|
register: result
|
||||||
|
|
||||||
- name: Configure networks under address family with operation replace
|
- assert:
|
||||||
ios_bgp: &af_net_rplc
|
that:
|
||||||
operation: replace
|
- 'result.changed == false'
|
||||||
config:
|
|
||||||
bgp_as: 64496
|
|
||||||
address_family:
|
|
||||||
- afi: ipv4
|
|
||||||
safi: multicast
|
|
||||||
networks:
|
|
||||||
- prefix: 198.51.100.80
|
|
||||||
masklen: 28
|
|
||||||
|
|
||||||
- prefix: 192.0.2.64
|
- name: Configure networks under address family with operation replace
|
||||||
masklen: 27
|
ios_bgp: &af_net_rplc
|
||||||
|
operation: replace
|
||||||
|
config:
|
||||||
|
bgp_as: 64496
|
||||||
|
address_family:
|
||||||
|
- afi: ipv4
|
||||||
|
safi: multicast
|
||||||
|
networks:
|
||||||
|
- prefix: 198.51.100.80
|
||||||
|
masklen: 28
|
||||||
|
|
||||||
- prefix: 203.0.113.192
|
- prefix: 192.0.2.64
|
||||||
masklen: 27
|
masklen: 27
|
||||||
|
|
||||||
- afi: ipv4
|
- prefix: 203.0.113.192
|
||||||
safi: unicast
|
masklen: 27
|
||||||
networks:
|
|
||||||
- prefix: 198.51.100.64
|
|
||||||
masklen: 28
|
|
||||||
register: result
|
|
||||||
|
|
||||||
- assert:
|
- afi: ipv4
|
||||||
that:
|
safi: unicast
|
||||||
- 'result.changed == true'
|
networks:
|
||||||
- '"router bgp 64496" in result.commands'
|
- prefix: 198.51.100.64
|
||||||
- '"address-family ipv4 multicast" in result.commands'
|
masklen: 28
|
||||||
- '"network 198.51.100.80 mask 255.255.255.240" in result.commands'
|
register: result
|
||||||
- '"network 203.0.113.192 mask 255.255.255.224" in result.commands'
|
|
||||||
- '"no network 198.51.100.48 mask 255.255.255.240 route-map RMAP_1" in result.commands'
|
|
||||||
- '"no network 203.0.113.160 mask 255.255.255.224 route-map RMAP_2" in result.commands'
|
|
||||||
- '"exit-address-family" in result.commands'
|
|
||||||
|
|
||||||
- name: Configure networks under address family with operation replace (idempotent)
|
- assert:
|
||||||
ios_bgp: *af_net_rplc
|
that:
|
||||||
register: result
|
- 'result.changed == true'
|
||||||
|
- '"router bgp 64496" in result.commands'
|
||||||
|
- '"address-family ipv4 multicast" in result.commands'
|
||||||
|
- '"network 198.51.100.80 mask 255.255.255.240" in result.commands'
|
||||||
|
- '"network 203.0.113.192 mask 255.255.255.224" in result.commands'
|
||||||
|
- '"no network 198.51.100.48 mask 255.255.255.240 route-map RMAP_1" in result.commands'
|
||||||
|
- '"no network 203.0.113.160 mask 255.255.255.224 route-map RMAP_2" in result.commands'
|
||||||
|
- '"exit-address-family" in result.commands'
|
||||||
|
|
||||||
- assert:
|
- name: Configure networks under address family with operation replace (idempotent)
|
||||||
that:
|
ios_bgp: *af_net_rplc
|
||||||
- 'result.changed == false'
|
register: result
|
||||||
|
|
||||||
- name: Configure redistribute information under address family mode
|
- assert:
|
||||||
ios_bgp: &af_rdr
|
that:
|
||||||
operation: merge
|
- 'result.changed == false'
|
||||||
config:
|
|
||||||
bgp_as: 64496
|
|
||||||
address_family:
|
|
||||||
- afi: ipv4
|
|
||||||
safi: multicast
|
|
||||||
redistribute:
|
|
||||||
- protocol: ospf
|
|
||||||
id: 112
|
|
||||||
metric: 64
|
|
||||||
|
|
||||||
- protocol: eigrp
|
- name: Configure redistribute information under address family mode
|
||||||
id: 233
|
ios_bgp: &af_rdr
|
||||||
metric: 256
|
operation: merge
|
||||||
register: result
|
config:
|
||||||
|
bgp_as: 64496
|
||||||
|
address_family:
|
||||||
|
- afi: ipv4
|
||||||
|
safi: multicast
|
||||||
|
redistribute:
|
||||||
|
- protocol: ospf
|
||||||
|
id: 112
|
||||||
|
metric: 64
|
||||||
|
|
||||||
- assert:
|
- protocol: eigrp
|
||||||
that:
|
id: 233
|
||||||
- 'result.changed == true'
|
metric: 256
|
||||||
- "'router bgp 64496' in result.commands"
|
register: result
|
||||||
- "'address-family ipv4 multicast' in result.commands"
|
|
||||||
- "'redistribute ospf 112 metric 64' in result.commands"
|
|
||||||
- "'redistribute eigrp 233 metric 256' in result.commands"
|
|
||||||
- "'exit-address-family' in result.commands"
|
|
||||||
|
|
||||||
- name: Configure redistribute information under address family mode (idempotent)
|
- assert:
|
||||||
ios_bgp: *af_rdr
|
that:
|
||||||
register: result
|
- 'result.changed == true'
|
||||||
|
- "'router bgp 64496' in result.commands"
|
||||||
|
- "'address-family ipv4 multicast' in result.commands"
|
||||||
|
- "'redistribute ospf 112 metric 64' in result.commands"
|
||||||
|
- "'redistribute eigrp 233 metric 256' in result.commands"
|
||||||
|
- "'exit-address-family' in result.commands"
|
||||||
|
|
||||||
- assert:
|
- name: Configure redistribute information under address family mode (idempotent)
|
||||||
that:
|
ios_bgp: *af_rdr
|
||||||
- 'result.changed == false'
|
register: result
|
||||||
|
|
||||||
- name: Configure redistribute information under address family mode with operation replace
|
- assert:
|
||||||
ios_bgp: &af_rdr_rplc
|
that:
|
||||||
operation: replace
|
- 'result.changed == false'
|
||||||
config:
|
|
||||||
bgp_as: 64496
|
|
||||||
address_family:
|
|
||||||
- afi: ipv4
|
|
||||||
safi: multicast
|
|
||||||
redistribute:
|
|
||||||
- protocol: ospf
|
|
||||||
id: 112
|
|
||||||
metric: 64
|
|
||||||
register: result
|
|
||||||
|
|
||||||
- assert:
|
- name: Get the IOS version
|
||||||
that:
|
ios_facts:
|
||||||
- 'result.changed == true'
|
gather_subset: all
|
||||||
- "'router bgp 64496' in result.commands"
|
|
||||||
- "'address-family ipv4 multicast' in result.commands"
|
|
||||||
- "'no redistribute eigrp 233' in result.commands"
|
|
||||||
- "'exit-address-family' in result.commands"
|
|
||||||
|
|
||||||
- name: Configure redistribute information under address family mode with operation replace (idempotent)
|
- name: Configure redistribute information under address family mode with operation replace
|
||||||
ios_bgp: *af_rdr_rplc
|
ios_bgp: &af_rdr_rplc
|
||||||
register: result
|
operation: replace
|
||||||
|
config:
|
||||||
|
bgp_as: 64496
|
||||||
|
address_family:
|
||||||
|
- afi: ipv4
|
||||||
|
safi: multicast
|
||||||
|
redistribute:
|
||||||
|
- protocol: ospf
|
||||||
|
id: 112
|
||||||
|
metric: 64
|
||||||
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
that:
|
that:
|
||||||
- 'result.changed == false'
|
- 'result.changed == true'
|
||||||
|
- "'router bgp 64496' in result.commands"
|
||||||
|
- "'address-family ipv4 multicast' in result.commands"
|
||||||
|
- "'no redistribute eigrp 233' in result.commands"
|
||||||
|
- "'exit-address-family' in result.commands"
|
||||||
|
|
||||||
- name: Override all the exisiting BGP config
|
- name: Configure redistribute information under address family mode with operation replace (idempotent)
|
||||||
ios_bgp:
|
ios_bgp: *af_rdr_rplc
|
||||||
operation: override
|
register: result
|
||||||
config:
|
when: ansible_net_version != "15.6(2)T"
|
||||||
bgp_as: 64497
|
|
||||||
router_id: 192.0.2.10
|
|
||||||
log_neighbor_changes: True
|
|
||||||
register: result
|
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
that:
|
that:
|
||||||
- 'result.changed == true'
|
- 'result.changed == false'
|
||||||
- "'no router bgp 64496' in result.commands"
|
when: ansible_net_version != "15.6(2)T"
|
||||||
- "'router bgp 64497' in result.commands"
|
|
||||||
- "'bgp router-id 192.0.2.10' in result.commands"
|
|
||||||
- "'bgp log-neighbor-changes' in result.commands"
|
|
||||||
|
|
||||||
- name: Teardown
|
- name: Override all the exisiting BGP config
|
||||||
ios_bgp: &rm
|
ios_bgp:
|
||||||
operation: delete
|
operation: override
|
||||||
register: result
|
config:
|
||||||
|
bgp_as: 64497
|
||||||
|
router_id: 192.0.2.10
|
||||||
|
log_neighbor_changes: True
|
||||||
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
that:
|
that:
|
||||||
- 'result.changed == true'
|
- 'result.changed == true'
|
||||||
- "'no router bgp 64497' in result.commands"
|
- "'no router bgp 64496' in result.commands"
|
||||||
|
- "'router bgp 64497' in result.commands"
|
||||||
|
- "'bgp router-id 192.0.2.10' in result.commands"
|
||||||
|
- "'bgp log-neighbor-changes' in result.commands"
|
||||||
|
|
||||||
- name: Teardown again (idempotent)
|
always:
|
||||||
ios_bgp: *rm
|
- name: Teardown
|
||||||
register: result
|
ios_bgp: &rm
|
||||||
|
operation: delete
|
||||||
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
that:
|
that:
|
||||||
- 'result.changed == false'
|
- 'result.changed == true'
|
||||||
|
- "'no router bgp 64497' in result.commands"
|
||||||
|
|
||||||
|
- name: Teardown again (idempotent)
|
||||||
|
ios_bgp: *rm
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- assert:
|
||||||
|
that:
|
||||||
|
- 'result.changed == false'
|
||||||
|
|
||||||
- debug: msg="END ios cli/ios_bgp.yaml on connection={{ ansible_connection }}"
|
- debug: msg="END ios cli/ios_bgp.yaml on connection={{ ansible_connection }}"
|
||||||
|
|
Loading…
Reference in a new issue