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

fix ansible-lint errors in playbooks directory #501

Merged
merged 12 commits into from
Feb 5, 2025
3 changes: 3 additions & 0 deletions changelogs/fragments/501-fix-ansible-lint-failures-3.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
trivial:
- playbooks - Fix ansible lint failures in playbooks/bgp_l3_fabric directory (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/501).
67 changes: 33 additions & 34 deletions playbooks/bgp_l3_fabric/clos-fabric.yaml
Original file line number Diff line number Diff line change
@@ -1,43 +1,42 @@
---
- hosts: datacenter
- name: "Configure BGP clos fabric options after configuring prerequisite options"
hosts: datacenter
gather_facts: false
connection: httpapi
gather_facts: no
collections:
- dellemc.enterprise_sonic
tasks:
- name: Create Interfaces
sonic_interfaces:
config: "{{sonic_interfaces}}"
when: sonic_interfaces is defined and sonic_interfaces
- name: Create Interfaces
dellemc.enterprise_sonic.sonic.sonic_interfaces:
config: "{{ sonic_interfaces }}"
when: sonic_interfaces is defined and sonic_interfaces

- name: Create L3 Interfaces
sonic_l3_interfaces:
config: "{{sonic_l3_interfaces}}"
when: sonic_l3_interfaces is defined and sonic_l3_interfaces
- name: Create L3 Interfaces
dellemc.enterprise_sonic.sonic..sonic_l3_interfaces:
config: "{{ sonic_l3_interfaces }}"
when: sonic_l3_interfaces is defined and sonic_l3_interfaces

- name: "Push configs for clos-fabric usecase"
vars:
ansible_connection: network_cli
sonic_config:
src: clos_fabric_cfg.j2
register: result
- name: "Push configs for clos-fabric usecase"
vars:
ansible_connection: network_cli
dellemc.enterprise_sonic.sonic.sonic_config:
src: clos_fabric_cfg.j2
register: result

- name: Create BGP configuration
sonic_bgp:
config: "{{sonic_bgp}}"
when: sonic_bgp is defined and sonic_bgp
- name: Create BGP configuration
dellemc.enterprise_sonic.sonic.sonic_bgp:
config: "{{ sonic_bgp }}"
when: sonic_bgp is defined and sonic_bgp

- name: Create BGP AF configuration
sonic_bgp_af:
config: "{{sonic_bgp_af}}"
when: sonic_bgp_af is defined and sonic_bgp_af
- name: Create BGP AF configuration
dellemc.enterprise_sonic.sonic.sonic_bgp_af:
config: "{{ sonic_bgp_af }}"
when: sonic_bgp_af is defined and sonic_bgp_af

- name: Create BGP Neighbors configuration
sonic_bgp_neighbors:
config: "{{sonic_bgp_neighbors}}"
when: sonic_bgp_neighbors is defined and sonic_bgp_neighbors
- name: Create BGP Neighbors configuration
dellemc.enterprise_sonic.sonic.sonic_bgp_neighbors:
config: "{{ sonic_bgp_neighbors }}"
when: sonic_bgp_neighbors is defined and sonic_bgp_neighbors

- name: Create BGP Neighbors AF configuration
sonic_bgp_neighbors_af:
config: "{{sonic_bgp_neighbors_af}}"
when: sonic_bgp_neighbors_af is defined and sonic_bgp_neighbors_af
- name: Create BGP Neighbors AF configuration
dellemc.enterprise_sonic.sonic.sonic_bgp_neighbors_af:
config: "{{ sonic_bgp_neighbors_af }}"
when: sonic_bgp_neighbors_af is defined and sonic_bgp_neighbors_af
37 changes: 19 additions & 18 deletions playbooks/bgp_l3_fabric/group_vars/all.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
ansible_user: admin
ansible_password: admin
ansible_password: admin
ansible_network_os: dellemc.enterprise_sonic.sonic

# Changing the interface name here will be reflected in all places
Expand All @@ -19,31 +20,31 @@ loopback_inf1: Loopback1

host_data:
leaf1:
loopback0_ip: 10.0.2.1/32
loopback1_ip: 10.10.10.1/32
bgp_asn: 65001
loopback0_ip: 10.0.2.1/32
loopback1_ip: 10.10.10.1/32
bgp_asn: 65001
leaf2:
loopback0_ip: 10.0.2.2/32
loopback1_ip: 10.10.10.2/32
bgp_asn: 65001
loopback0_ip: 10.0.2.2/32
loopback1_ip: 10.10.10.2/32
bgp_asn: 65001
leaf25:
loopback0_ip: 10.0.2.25/32
loopback1_ip: 10.10.10.25/32
bgp_asn: 65025
loopback0_ip: 10.0.2.25/32
loopback1_ip: 10.10.10.25/32
bgp_asn: 65025
leaf26:
loopback0_ip: 10.0.2.26/32
loopback1_ip: 10.10.10.26/32
bgp_asn: 65025
loopback0_ip: 10.0.2.26/32
loopback1_ip: 10.10.10.26/32
bgp_asn: 65025
spine1:
loopback0_ip: 10.0.1.1/32
bgp_asn: 65000
loopback0_ip: 10.0.1.1/32
bgp_asn: 65000
spine2:
loopback0_ip: 10.0.1.2/32
bgp_asn: 65000
loopback0_ip: 10.0.1.2/32
bgp_asn: 65000

ansible_httpapi_use_ssl: true
ansible_httpapi_validate_certs: false

loopback0_ip: "{{ host_data[inventory_hostname].loopback0_ip }}"
loopback1_ip: "{{host_data[inventory_hostname].loopback1_ip}}"
loopback1_ip: "{{ host_data[inventory_hostname].loopback1_ip }}"
bgp_asn: "{{ host_data[inventory_hostname].bgp_asn }}"
129 changes: 65 additions & 64 deletions playbooks/bgp_l3_fabric/group_vars/leaf.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
sonic_interfaces:
- name: "{{ leaf_spine1_inf1 }}"
description: "{{ leaf_spine1_inf1 }} Spine1"
Expand All @@ -6,98 +7,98 @@ sonic_interfaces:
description: "{{ leaf_spine2_inf2 }} Spine2"
enabled: true
- name: "{{ loopback_inf0 }}"
- name: "{{ loopback_inf1 }}"
- name: "{{ loopback_inf1 }}"

sonic_l3_interfaces:
- name: "{{ loopback_inf0 }}"
ipv4:
addresses:
- address: "{{ loopback0_ip }}"
addresses:
- address: "{{ loopback0_ip }}"
- name: "{{ loopback_inf1 }}"
ipv4:
addresses:
- address: "{{ loopback1_ip }}"
addresses:
- address: "{{ loopback1_ip }}"
- name: "{{ leaf_spine1_inf1 }}"
ipv6:
enabled: true
enabled: true
- name: "{{ leaf_spine2_inf2 }}"
ipv6:
enabled: true
enabled: true

sonic_route_maps_cli:
- name: REDISTU
permit: true
seq: 10
match_ip_prefix_list: UNDERLAY
- name: REDISTL3
permit: true
seq: 10
match_ip_prefix_list: L3OVERLAY
- name: REDISTU
permit: true
seq: 10
match_ip_prefix_list: UNDERLAY
- name: REDISTL3
permit: true
seq: 10
match_ip_prefix_list: L3OVERLAY

sonic_prefix_list_cli:
- name: UNDERLAY
permit: true
entries:
- ip: 10.0.2.0/24
condition: ge 32 le 32
seq: 1
- ip: 10.10.10.0/24
condition: ge 32 le 32
seq: 2
- name: L3OVERLAY
permit: true
entries:
- ip: 192.168.50.0/24
seq: 3
- name: UNDERLAY
permit: true
entries:
- ip: 10.0.2.0/24
condition: ge 32 le 32
seq: 1
- ip: 10.10.10.0/24
condition: ge 32 le 32
seq: 2
- name: L3OVERLAY
permit: true
entries:
- ip: 192.168.50.0/24
seq: 3

sonic_bgp:
- bgp_as: "{{ bgp_asn }}"
router_id: "{{ loopback0_ip.split('/')[0] }}"
bestpath:
as_path:
multipath_relax: true
as_path:
multipath_relax: true

sonic_bgp_af:
- bgp_as: "{{ bgp_asn }}"
address_family:
- bgp_as: "{{ bgp_asn }}"
address_family:
afis:
- afi: l2vpn
safi: evpn
advertise_all_vni: true
- afi: ipv4
safi: unicast
redistribute:
- protocol: connected
route_map: REDISTU
- afi: l2vpn
safi: evpn
advertise_all_vni: true
- afi: ipv4
safi: unicast
redistribute:
- protocol: connected
route_map: REDISTU

sonic_bgp_neighbors:
- bgp_as: "{{ bgp_asn }}"
peer_group:
- bgp_as: "{{ bgp_asn }}"
peer_group:
- name: SPINE
remote_as:
peer_type: external
peer_type: external
advertisement_interval: 5
timers:
keepalive: 3
holdtime: 9
keepalive: 3
holdtime: 9
bfd:
check_failure: true
enabled: true
profile: 'profile 1'
check_failure: true
enabled: true
profile: 'profile 1'
capability:
extended_nexthop: true
extended_nexthop: true
address_family:
afis:
- afi: l2vpn
safi: evpn
activate: true
- afi: ipv4
safi: unicast
activate: true
allowas_in:
value: 2
neighbors:
- neighbor: "{{ leaf_spine1_inf1 }}"
peer_group: SPINE
- neighbor: "{{ leaf_spine2_inf2 }}"
peer_group: SPINE
afis:
- afi: l2vpn
safi: evpn
activate: true
- afi: ipv4
safi: unicast
activate: true
allowas_in:
value: 2
neighbors:
- neighbor: "{{ leaf_spine1_inf1 }}"
peer_group: SPINE
- neighbor: "{{ leaf_spine2_inf2 }}"
peer_group: SPINE
Loading
Loading