Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated example playbooks to reflect module updates #102

Merged
merged 4 commits into from
Aug 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion playbooks/bgp_l3_fabric/group_vars/leaf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,10 @@ sonic_bgp_neighbors:
timers:
keepalive: 3
holdtime: 9
bfd: true
bfd:
check_failure: true
enabled: true
profile: 'profile 1'
capability:
extended_nexthop: true
address_family:
Expand Down
5 changes: 4 additions & 1 deletion playbooks/bgp_l3_fabric/group_vars/spine.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ sonic_bgp_neighbors:
timers:
keepalive: 3
holdtime: 9
bfd: true
bfd:
check_failure: true
enabled: true
profile: 'profile1'
capability:
extended_nexthop: true
address_family:
Expand Down
60 changes: 46 additions & 14 deletions playbooks/common_examples/sonic_bgp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
commands:
- route-map aa permit 11
- route-map bb permit 22
- ip prefix-list p1 seq 1 permit 1.1.1.0/24
- ip prefix-list p2 seq 2 permit 2.2.2.128/25
save: yes
- name: Configure VRFs
sonic_vrfs:
Expand Down Expand Up @@ -96,11 +98,11 @@
safi: evpn
advertise_all_vni: True
advertise_default_gw: True
advertise_prefix:
- afi: ipv4
safi: unicast
- afi: ipv6
safi: unicast
route_advertise_list:
- advertise_afi: ipv4
route_map: aa
- advertise_afi: ipv6
route_map: bb
- bgp_as: "{{bgp_as2}}"
vrf_name: "{{vrf1}}"
address_family:
Expand Down Expand Up @@ -132,11 +134,11 @@
- afi: l2vpn
safi: evpn
advertise_default_gw: True
advertise_prefix:
- afi: ipv4
safi: unicast
- afi: ipv6
safi: unicast
route_advertise_list:
- advertise_afi: ipv4
route_map: aa
- advertise_afi: ipv6
route_map: bb
state: merged
- name: "Test sonic_bgp_neighbors merged state"
sonic_bgp_neighbors:
Expand All @@ -146,14 +148,31 @@
- name: SPINE
remote_as:
peer_type: internal
bfd: true
bfd:
check_failure: true
enabled: true
profile: 'profile 1'
advertisement_interval: 15
timers:
keepalive: 50
holdtime: 40
capability:
dynamic: true
extended_nexthop: true
address_family:
afis:
- afi: ipv4
safi: unicast
ip_afi:
default_policy_name: aa
send_default_route: false
prefix_limit:
max_prefixes: 200
prevent_teardown: false
warning_threshold: 88
restart_timer: 5
prefix_list_in: p2
prefix_list_out: p1
- name: SPINE2
neighbors:
- neighbor: Eth1/1
Expand All @@ -164,7 +183,8 @@
timers:
keepalive: 40
holdtime: 50
bfd: true
bfd:
enabled: false
capability:
dynamic: true
extended_nexthop: true
Expand All @@ -185,7 +205,10 @@
- name: SPINE3
remote_as:
peer_type: internal
bfd: true
bfd:
check_failure: false
enabled: true
profile: 'profile 3'
advertisement_interval: 15
timers:
keepalive: 50
Expand Down Expand Up @@ -231,6 +254,15 @@
direction: in
route_reflector_client: true
route_server_client: true
ip_afi:
default_policy_name: bb
send_default_route: true
prefix_limit:
max_prefixes: 100
prevent_teardown: true
warning_threshold: 80
kerry-meyer marked this conversation as resolved.
Show resolved Hide resolved
prefix_list_in: p1
prefix_list_out: p2
- bgp_as: "{{bgp_as2}}"
vrf_name: "{{vrf1}}"
neighbors:
Expand Down Expand Up @@ -286,4 +318,4 @@
direction: in
route_reflector_client: true
route_server_client: true
state: merged
state: merged
6 changes: 4 additions & 2 deletions playbooks/common_examples/sonic_bgp_communities.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@
- "11"
- "22"
- "33"
permit: true
- name: test_1
members:
- "101.101"
- "201.201"
- "301.301"
- "301.301"
permit: false
state: merged
- name: Add bgp_community configuration
sonic_bgp_communities:
Expand Down Expand Up @@ -61,4 +63,4 @@
route_origin:
- "301.301"
- "401.401"
state: merged
state: merged
1 change: 1 addition & 0 deletions playbooks/common_examples/sonic_vxlans_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
config:
- name: vteptest1
source_ip: 1.1.1.1
primary_ip: 2.2.2.2
evpn_nvo: nvo6
vlan_map:
- vni: 101
Expand Down
11 changes: 10 additions & 1 deletion plugins/modules/sonic_bgp_as_paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
#
# show bgp as-path-access-list
# AS path list test:
# action: permit
# members: 808.*,909.*

- name: Delete BGP as path list
Expand All @@ -88,13 +89,15 @@
- name: test
members:
- 909.*
permit: true
state: deleted

# After state:
# ------------
#
# show bgp as-path-access-list
# AS path list test:
# action:
# members: 808.*


Expand All @@ -105,8 +108,10 @@
#
# show bgp as-path-access-list
# AS path list test:
# action: permit
# members: 808.*,909.*
# AS path list test1:
# action: deny
# members: 608.*,709.*

- name: Deletes BGP as-path list
Expand All @@ -121,6 +126,7 @@
#
# show bgp as-path-access-list
# AS path list test1:
# action: deny
# members: 608.*,709.*


Expand All @@ -131,6 +137,7 @@
#
# show bgp as-path-access-list
# AS path list test:
# action: permit
# members: 808.*,909.*

- name: Deletes BGP as-path list
Expand All @@ -142,7 +149,7 @@
# ------------
#
# show bgp as-path-access-list
#
# (No bgp as-path-access-list configuration present)


# Using merged
Expand All @@ -159,13 +166,15 @@
- name: test
members:
- 909.*
permit: true
state: merged

# After state:
# ------------
#
# show bgp as-path-access-list
# AS path list test:
# action: permit
# members: 909.*


Expand Down
53 changes: 26 additions & 27 deletions tests/unit/utils/test_16_complex_list_with_dict_diff.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ test_keys:
- safi
- redistribute:
- protocol
- advertise_prefix:
- afi
- safi
- route_advertise_list:
- advertise_afi
want:
- bgp_as: 51
vrf_name: vrf1
Expand Down Expand Up @@ -49,11 +48,11 @@ want:
- afi: l2vpn
safi: evpn
advertise_all_vni: True
advertise_prefix:
- afi: ipv4
safi: unicast
- afi: ipv6
safi: unicast
route_advertise_list:
- advertise_afi: ipv4
route_map: rmap_reg1
- advertise_afi: ipv6
route_map: rmap_reg2
- bgp_as: 52
vrf_name: vrf2
address_family:
Expand Down Expand Up @@ -90,9 +89,9 @@ want:
route_map: rmap_regc.1
- afi: l2vpn
safi: evpn
advertise_prefix:
- afi: ipv6
safi: unicast
route_advertise_list:
- advertise_afi: ipv6
route_map: rmap_reg2
have:
- bgp_as: 50
vrf_name: vrf1
Expand Down Expand Up @@ -131,11 +130,11 @@ have:
- afi: l2vpn
safi: evpn
advertise_all_vni: True
advertise_prefix:
- afi: ipv4
safi: unicast
- afi: ipv6
safi: unicast
route_advertise_list:
- advertise_afi: ipv4
route_map: rmap_reg1
- advertise_afi: ipv6
route_map: rmap_reg2
- bgp_as: 52
vrf_name: vrf2
address_family:
Expand Down Expand Up @@ -172,9 +171,9 @@ have:
route_map: rmap_regc
- afi: l2vpn
safi: evpn
advertise_prefix:
- afi: ipv4
safi: unicast
route_advertise_list:
- advertise_afi: ipv4
route_map: rmap_reg1
diff:
- bgp_as: 51
vrf_name: vrf1
Expand Down Expand Up @@ -213,11 +212,11 @@ diff:
- afi: l2vpn
safi: evpn
advertise_all_vni: True
advertise_prefix:
- afi: ipv4
safi: unicast
- afi: ipv6
safi: unicast
route_advertise_list:
- advertise_afi: ipv4
route_map: rmap_reg1
- advertise_afi: ipv6
route_map: rmap_reg2
- bgp_as: 52
vrf_name: vrf2
address_family:
Expand Down Expand Up @@ -248,6 +247,6 @@ diff:
route_map: rmap_regc.1
- afi: l2vpn
safi: evpn
advertise_prefix:
- afi: ipv6
safi: unicast
route_advertise_list:
- advertise_afi: ipv6
route_map: rmap_reg2