Skip to content
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
11 changes: 6 additions & 5 deletions ansible/roles/fanout/tasks/fanout_sonic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@
port_alias: hwsku="{{ device_info["HwSku"] }}"

- name: build fanout vlan config
template: src=sonic_deploy.j2
fail: msg="SONiC fanout switch with HwSku {{ device_info.HwSku }} not supported"
when: device_info.HwSku != "Arista-7060CX-32S-C32"

- name: build fanout startup config for Arista 7060 SONiC leaf fanout
template: src=sonic_deploy_arista_7060.j2
dest=/etc/sonic/vlan.json
when: device_info.HwSku == "Arista-7060CX-32S-C32"
become: yes

- name: disable all copp rules
Expand All @@ -20,10 +25,6 @@
shell: sonic-cfggen -H -j /etc/sonic/vlan.json -j /etc/sonic/init_cfg.json --print-data > /etc/sonic/config_db.json
become: yes

- name: reload config_db.json
shell: config reload -y
become: yes

- name: stop and disable lldp service
service: name=lldp state=stopped enabled=no
become: yes
Expand Down
214 changes: 214 additions & 0 deletions ansible/roles/fanout/templates/sonic_deploy_arista_7060.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,214 @@
{

"DEVICE_METADATA": {
"localhost": {
"hwsku": "{{ device_info["HwSku"] }}",
"hostname": "{{ inventory_hostname }}"
}
},

"PORT": {
{% for alias in device_conn %}
"{{ alias }}": {
"admin_status": "up",
"speed": "100000",
"fec": "rs"
}{% if not loop.last %},{% endif %}
{% endfor %}
},

"VLAN": {
{% for vlanid in device_vlan_list | unique %}
"Vlan{{ vlanid }}": {
"vlanid": "{{ vlanid }}"
}{% if not loop.last %},{% endif %}
{% endfor %}
},

{% set ns = {'firstPrinted': False} %}
"VLAN_MEMBER": {
{% for alias in device_port_vlans %}
{% if device_port_vlans[alias]['mode'] == 'Access' %}
{% if ns.firstPrinted %},{% endif %}
"Vlan{{ device_port_vlans[alias]['vlanids'] }}|{{ alias }}": {
"tagging_mode" : "untagged"
}
{% if ns.update({'firstPrinted': True}) %} {% endif %}
{% elif device_port_vlans[alias]['mode'] == 'Trunk' %}
{% for vlanid in device_port_vlans[alias]['vlanlist'] %}
{% if ns.firstPrinted %},{% endif %}
"Vlan{{ vlanid }}|{{ alias }}": {
"tagging_mode" : "tagged"
}
{% if ns.update({'firstPrinted': True}) %} {% endif %}
{% endfor %}
{% endif %}
{% endfor %}
},

"MGMT_INTERFACE": {
"eth0|{{ device_info["ManagementIp"] }}": {
"gwaddr": "{{ device_info["ManagementGw"] }}"
}
},

"FLEX_COUNTER_TABLE": {
"PFCWD": {
"FLEX_COUNTER_STATUS": "enable"
},
"PORT": {
"FLEX_COUNTER_STATUS": "enable"
},
"QUEUE": {
"FLEX_COUNTER_STATUS": "enable"
}
},

"QUEUE": {
{% for alias in device_conn %}
"{{ alias }}|0": {
"scheduler": "[SCHEDULER|scheduler.0]"
},
"{{ alias }}|1": {
"scheduler": "[SCHEDULER|scheduler.0]"
},
"{{ alias }}|2": {
"scheduler": "[SCHEDULER|scheduler.0]"
},
"{{ alias }}|3": {
"wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]",
"scheduler": "[SCHEDULER|scheduler.1]"
},
"{{ alias }}|4": {
"wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]",
"scheduler": "[SCHEDULER|scheduler.1]"
},
"{{ alias }}|5": {
"scheduler": "[SCHEDULER|scheduler.0]"
},
"{{ alias }}|6": {
"scheduler": "[SCHEDULER|scheduler.0]"
}{% if not loop.last %},{% endif %}
{% endfor %}
},

"BUFFER_QUEUE": {
{% for alias in device_conn %}
"{{ alias }}|0-2": {
"profile": "[BUFFER_PROFILE|egress_lossy_profile]"
},
"{{ alias }}|3-4": {
"profile": "[BUFFER_PROFILE|egress_lossless_profile]"
},
"{{ alias }}|5-6": {
"profile": "[BUFFER_PROFILE|egress_lossy_profile]"
}{% if not loop.last %},{% endif %}
{% endfor %}
},

"BUFFER_PG": {
{% for alias in device_conn %}
"{{ alias }}|0": {
"profile": "[BUFFER_PROFILE|ingress_lossy_profile]"
},
"{{ alias }}|3-4": {
"profile": "[BUFFER_PROFILE|pg_lossless_100000_300m_profile]"
}{% if not loop.last %},{% endif %}
{% endfor %}
},

"CABLE_LENGTH": {
"AZURE": {
{% for alias in device_conn %}
"{{ alias }}": "300m"{% if not loop.last %},{% endif %}
{% endfor %}
}
},

"VERSIONS": {
"DATABASE": {
"VERSION": "version_1_0_1"
}
},

"PFC_WD": {
"GLOBAL": {
"POLL_INTERVAL": "200"
}
},

"WRED_PROFILE": {
"AZURE_LOSSLESS": {
"red_max_threshold": "2097152",
"red_drop_probability": "5",
"wred_green_enable": "true",
"ecn": "ecn_all",
"green_min_threshold": "250000",
"red_min_threshold": "1048576",
"wred_yellow_enable": "true",
"yellow_min_threshold": "1048576",
"green_max_threshold": "2097152",
"green_drop_probability": "5",
"yellow_max_threshold": "2097152",
"yellow_drop_probability": "5",
"wred_red_enable": "true"
}
},

"SCHEDULER": {
"scheduler.0": {
"type": "DWRR",
"weight": "14"
},
"scheduler.1": {
"type": "DWRR",
"weight": "15"
}
},

"BUFFER_POOL": {
"egress_lossless_pool": {
"type": "egress",
"mode": "static",
"size": "15982720"
},
"egress_lossy_pool": {
"type": "egress",
"mode": "dynamic",
"size": "9243812"
},
"ingress_lossless_pool": {
"xoff": "4194112",
"type": "ingress",
"mode": "dynamic",
"size": "10875072"
}
},

"BUFFER_PROFILE": {
"egress_lossless_profile": {
"static_th": "15982720",
"pool": "[BUFFER_POOL|egress_lossless_pool]",
"size": "1518"
},
"egress_lossy_profile": {
"dynamic_th": "3",
"pool": "[BUFFER_POOL|egress_lossy_pool]",
"size": "1518"
},
"ingress_lossy_profile": {
"dynamic_th": "3",
"pool": "[BUFFER_POOL|ingress_lossless_pool]",
"size": "0"
},
"pg_lossless_100000_300m_profile": {
"xon_offset": "2288",
"dynamic_th": "0",
"xon": "2288",
"xoff": "268736",
"pool": "[BUFFER_POOL|ingress_lossless_pool]",
"size": "1248"
}
}

}