From 8f692d044742af01206bdbf4ea5695f12650ad7d Mon Sep 17 00:00:00 2001 From: Prabhat Aravind Date: Thu, 19 Feb 2026 01:56:45 +0000 Subject: [PATCH 1/2] Update lit mode setting logic for smartswitch testbeds * Instead of using a default true value, read it from the testbed file and set it accordingly. * If no such parameter exists in testbed file, derive lit mode status from topology Signed-off-by: Prabhat Aravind --- ansible/config_sonic_basedon_testbed.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/ansible/config_sonic_basedon_testbed.yml b/ansible/config_sonic_basedon_testbed.yml index da243b982ec..c85fb86eb50 100644 --- a/ansible/config_sonic_basedon_testbed.yml +++ b/ansible/config_sonic_basedon_testbed.yml @@ -148,10 +148,9 @@ topo: "{{ testbed_facts['topo'] }}" tags: always - - name: set default light mode + - name: set lit mode set_fact: - is_light_mode: true - when: topo in ["t1-smartswitch-ha","t1-28-lag","smartswitch-t1", "t1-48-lag"] and is_light_mode is not defined + is_lit_mode: "{{ testbed_facts.get('is_lit_mode', topo in ['t1-smartswitch-ha', 't1-28-lag', 'smartswitch-t1', 't1-48-lag']) }}" tags: always - name: set ptf image name @@ -768,7 +767,7 @@ dest=/tmp/smartswitch.json become: true # t1-28-lag is smartswitch topo only - when: topo in ["t1-smartswitch-ha","t1-28-lag","smartswitch-t1", "t1-48-lag"] and is_light_mode|bool == true + when: topo in ["t1-smartswitch-ha","t1-28-lag","smartswitch-t1", "t1-48-lag"] and is_lit_mode|bool == true - name: Create dns config template: src=templates/dns_config.j2 @@ -823,7 +822,7 @@ port_index_map: "{{ port_index_map | default({}) }}" hwsku: "{{ hwsku }}" vm_configuration: "{{ configuration if topo == 't1-filterleaf-lag' else omit }}" - is_light_mode: "{{ is_light_mode | default(true) }}" + is_lit_mode: "{{ is_lit_mode | default(true) }}" become: true - name: Copy macsec profile json to dut @@ -1034,7 +1033,7 @@ dest=/tmp/dpu_extra.json become: true # t1-28-lag is smartswitch topo only - when: topo in ["t1-smartswitch-ha","t1-28-lag","smartswitch-t1", "t1-48-lag"] and is_light_mode|bool == true + when: topo in ["t1-smartswitch-ha","t1-28-lag","smartswitch-t1", "t1-48-lag"] and is_lit_mode|bool == true tags: [ dpu_config ] - name: Load DPU config in smartswitch @@ -1044,7 +1043,7 @@ host_passwords: "{{ sonic_default_passwords }}" become: true # t1-28-lag is smartswitch topo only - when: topo in ["t1-smartswitch-ha","t1-28-lag","smartswitch-t1", "t1-48-lag"] and is_light_mode|bool == true + when: topo in ["t1-smartswitch-ha","t1-28-lag","smartswitch-t1", "t1-48-lag"] and is_lit_mode|bool == true tags: [ dpu_config ] - name: Configure TACACS From 984e35fa98f08ac9adb16037aa53cbcde1dc9978 Mon Sep 17 00:00:00 2001 From: Prabhat Aravind Date: Thu, 19 Feb 2026 16:07:34 +0000 Subject: [PATCH 2/2] Update generate_golden_config_db.py Signed-off-by: Prabhat Aravind --- ansible/library/generate_golden_config_db.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ansible/library/generate_golden_config_db.py b/ansible/library/generate_golden_config_db.py index 15738f59be1..c64c567a969 100644 --- a/ansible/library/generate_golden_config_db.py +++ b/ansible/library/generate_golden_config_db.py @@ -60,7 +60,7 @@ def __init__(self): num_asics=dict(require=False, type='int', default=1), hwsku=dict(require=False, type='str', default=None), vm_configuration=dict(require=False, type='dict', default={}), - is_light_mode=dict(require=False, type='bool', default=True)), + is_lit_mode=dict(require=False, type='bool', default=True)), supports_check_mode=True) self.topo_name = self.module.params['topo_name'] self.port_index_map = self.module.params['port_index_map'] @@ -70,7 +70,7 @@ def __init__(self): self.platform, _ = device_info.get_platform_and_hwsku() self.vm_configuration = self.module.params['vm_configuration'] - self.is_light_mode = self.module.params['is_light_mode'] + self.is_lit_mode = self.module.params['is_lit_mode'] def generate_mgfx_golden_config_db(self): rc, out, err = self.module.run_command("sonic-cfggen -H -m -j /etc/sonic/init_cfg.json --print-data") @@ -602,7 +602,7 @@ def generate(self): module_msg = module_msg + " for mgfx" self.module.run_command("sudo rm -f {}".format(TEMP_DHCP_SERVER_CONFIG_PATH)) elif self.topo_name in ["t1-smartswitch-ha", "t1-28-lag", "smartswitch-t1", "t1-48-lag"] \ - and self.is_light_mode: + and self.is_lit_mode: config = self.generate_smartswitch_golden_config_db() module_msg = module_msg + " for smartswitch" self.module.run_command("sudo rm -f {}".format(TEMP_SMARTSWITCH_CONFIG_PATH))