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
13 changes: 6 additions & 7 deletions ansible/config_sonic_basedon_testbed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions ansible/library/generate_golden_config_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand All @@ -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")
Expand Down Expand Up @@ -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))
Expand Down
Loading