Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

metalbox-sonic

Use dellemc.enterprise_sonic on OSISM Metalbox.

Config generation

The base configuration is added to the device config_context in netbox, under the key sonic_ansible_config.

sonic_ansible_config:
  bgp:
    - bestpath:
        as_path:
          multipath_relax: true
        bgp_as: 4200000232
        router_id: 192.168.255.232
    - bestpath:
        as_path:
          multipath_relax: true
        bgp_as: 4210167232
        router_id: 10.10.0.10
        vrf_name: Vrf_data
...

The config_context is used by the config generator, which will extend the config with dynamic values (currently only server downlinks). The output is then saved into a custom field called sonic_parameters.

For each VRF used by downlinks, map the BGP afi_config template in config.yml

vrf_mapping:
  - name: Vrf_data
    afi_config:
      - activate: true
        afi: ipv4
        prefix_list_in: data-v4-in
        prefix_list_out: data-v4-out
        safi: unicast
      - activate: true
        afi: ipv6
        prefix_list_in: data-v6-in
        prefix_list_out: data-v6-out
        safi: unicast

Specify which device roles are eligible for automatic downlink generation in config.yml as well

downlink_roles:
  - compute
  - control
  - storage
  - ceph-control
  - loadbalancer
  - network

Also, add the netbox parameters to config.yml

netbox:
  url: http://metalbox:8121
  token: "0000000000000000000000000000000000000000"

Generate the config for each switch:

python3 config_generator.py <device_name>

Deploying config

To deploy the config, use the example playbook.

osism apply --environment manager sonic-config -e switch_hostname=leafsw01

Secrets

Switch credentials should be added to the secrets custom field. Use ansible-vault to encrypt the value of sonic_password. sonic_username is expected to be plain text.

DHCP and ZTP

Currently, this approach does not support initial zero-touch provisioning. DHCP can still be used to provide IPv4 addressing to the switches.

Supported config resouces

See https://github.com/ansible-collections/dellemc.enterprise_sonic for documentation about the individual resources. The example playbook under playbooks/ supports the following resources:

Module Key
sonic_system system
sonic_port_breakout port_breakouts
sonic_interfaces interfaces
sonic_vlans vlans
sonic_vrfs vrfs
sonic_lag_interfaces lag_interfaces
sonic_l2_interfaces l2_interfaces
sonic_l3_interfaces l3_interfaces
sonic_prefix_lists prefix_lists
sonic_bgp bgp
sonic_bgp_af bgp_af
sonic_bgp_neighbors bgp_neighbors
sonic_bgp_neighbors_af bgp_neighbors_af
sonic_vxlans vxlans
sonic_static_routes static_routes
sonic_evpn_esi_multihome evpn_esi_multihome

About

Building blocks for using ansible to configure SONiC on OSISM Metalbox

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages