-
Notifications
You must be signed in to change notification settings - Fork 715
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
add sonic fanout support #485
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
ansible_ssh_user: user | ||
ansible_ssh_pass: password | ||
fanout_sonic_user: admin | ||
fanout_sonic_password: password |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
- name: prepare fanout switch admin login info | ||
set_fact: ansible_ssh_user={{ fanout_admin_user }} ansible_ssh_pass={{ fanout_admin_password }} | ||
|
||
- name: create persistent shell login | ||
file: path=/mnt/flash/rc.eos state=touch | ||
become: yes | ||
|
||
- name: save persistent shell login | ||
template: src=rc.eos.j2 | ||
dest=/mnt/flash/rc.eos | ||
become: yes | ||
|
||
- name: build fanout startup config for Arista fanout leaf | ||
template: src=arista_7260_deploy.j2 | ||
dest=/mnt/flash/startup-config | ||
when: device_info.HwSku == "Arista-7260QX-64" | ||
become: yes | ||
|
||
- name: build fanout startup config for 7060 | ||
template: src=arista_7060_deploy.j2 | ||
dest=/mnt/flash/startup-config | ||
when: device_info.HwSku == "Arista-7060CX-32S" | ||
become: yes | ||
|
||
- name: reboot | ||
shell: sleep 2 && shutdown -r now "Reboot" | ||
async: 1 | ||
poll: 0 | ||
ignore_errors: true | ||
become: yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
- debug: msg="{{ device_info }}" | ||
|
||
- name: prepare fanout switch admin login info | ||
set_fact: ansible_user={{ fanout_sonic_user }} ansible_password={{ fanout_sonic_password }} | ||
|
||
- name: build fanout vlan config | ||
template: src=sonic_deploy.j2 | ||
dest=/etc/sonic/vlan.json | ||
become: yes | ||
|
||
- name: disable all copp rules | ||
copy: content='[]' | ||
dest=/etc/swss/config.d/00-copp.config.json | ||
become: yes | ||
vars: | ||
ansible_shell_type: docker | ||
ansible_python_interpreter: docker exec -i swss python | ||
|
||
- name: generate config_db.json | ||
shell: sonic-cfggen -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 | ||
|
||
- name: stop and disable dhcp_relay service | ||
service: name=dhcp_relay state=stopped enabled=no | ||
become: yes | ||
|
||
- name: stop and disable bgp service | ||
service: name=bgp state=stopped enabled=no | ||
become: yes | ||
|
||
- name: stop and disable teamd service | ||
service: name=teamd state=stopped enabled=no | ||
become: yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{ | ||
|
||
"DEVICE_METADATA": { | ||
"localhost": { | ||
"hwsku": "{{ device_info["HwSku"] }}", | ||
"hostname": "{{ inventory_hostname }}" | ||
} | ||
}, | ||
|
||
"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 port in device_port_vlans %} | ||
{% if device_port_vlans[port]['mode'] == 'Access' %} | ||
{% if ns.firstPrinted %},{% endif %} | ||
"Vlan{{ device_port_vlans[port]['vlanids'] }}|{{ port }}": { | ||
"tagging_mode" : "untagged" | ||
} | ||
{% if ns.update({'firstPrinted': True}) %} {% endif %} | ||
{% elif device_port_vlans[port]['mode'] == 'Trunk' %} | ||
{% for vlanid in device_port_vlans[port]['vlanlist'] %} | ||
{% if ns.firstPrinted %},{% endif %} | ||
"Vlan{{ vlanid }}|{{ port }}": { | ||
"tagging_mode" : "tagged" | ||
} | ||
{% if ns.update({'firstPrinted': True}) %} {% endif %} | ||
{% endfor %} | ||
{% endif %} | ||
{% endfor %} | ||
}, | ||
|
||
"MGMT_INTERFACE": { | ||
"eth0|{{ device_info["ManagementIp"] }}": { | ||
"gwaddr": "{{ device_info["ManagementGw"] }}" | ||
} | ||
} | ||
|
||
} | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the last curly parentheses needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes