Skip to content

Commit 393302d

Browse files
Xichen96venu-nexthop
authored andcommitted
[8101] Fix bug that confuses sonic name with alias (sonic-net#18744)
What is the motivation for this PR? Fix 8101 fanout deployment bug How did you do it? The previous ansible template does not distinguish between sonic name and alias in the links file, which causes sonic unable to understand vlan members which should always be sonic name How did you verify/test it? Deployed fanout Any platform specific information? Cisco-8101 only
1 parent bfc6d46 commit 393302d

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

ansible/roles/fanout/tasks/sonic/fanout_sonic_cisco_8101_202205.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
- name: backup config_db.json
1717
shell: cp /etc/sonic/config_db.json /etc/sonic/config_db.json.bak
18+
become: yes
19+
ignore_errors: yes
1820

1921
- name: generate config_db.json
2022
shell: sonic-cfggen -H -j /tmp/base_config.json --print-data > /etc/sonic/config_db.json
@@ -35,23 +37,23 @@
3537
block:
3638
- name: disable feature teamd
3739
shell: config feature state teamd disabled
38-
become: true
40+
become: yes
3941
- name: ensure teamd container is stopped
4042
docker_container:
4143
name: teamd
4244
state: stopped
43-
become: true
45+
become: yes
4446
ignore_errors: yes
4547
- name: remove teamd container
4648
docker_container:
4749
name: teamd
4850
state: absent
49-
become: true
51+
become: yes
5052
when: teamd_container.stdout != ""
5153

5254
- name: SONiC update config db
5355
shell: config reload -y -f
54-
become: true
56+
become: yes
5557

5658
- name: wait for SONiC update config db finish
5759
pause:

ansible/roles/fanout/templates/sonic_deploy_cisco_8101_202205.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020
{% if device_port_vlans[port_name]["mode"].lower() == "access" %}
2121
{% if ns.notFirstPrinted %},
2222
{% endif %}
23-
"Vlan{{ device_port_vlans[port_name]["vlanids"] }}|{{ port_name }}": {
23+
"Vlan{{ device_port_vlans[port_name]["vlanids"] }}|{{ lookup("cisco_8101_port_convert", port_name, speed=device_conn[port_name]["speed"], output="sonic") }}": {
2424
"tagging_mode": "untagged"
2525
}{% if ns.update({"notFirstPrinted": True}) %} {% endif %}
2626
{% elif device_port_vlans[port_name]["mode"].lower() == "trunk" %}
2727
{% for vlanid in device_port_vlans[port_name]["vlanlist"] %}
2828
{% if ns.notFirstPrinted %},
2929
{% endif %}
30-
"Vlan{{ vlanid }}|{{ port_name }}": {
30+
"Vlan{{ vlanid }}|{{ lookup("cisco_8101_port_convert", port_name, speed=device_conn[port_name]["speed"], output="sonic") }}": {
3131
"tagging_mode": "tagged"
3232
}{% if ns.update({"notFirstPrinted": True}) %} {% endif %}
3333
{% endfor %}

0 commit comments

Comments
 (0)