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
12 changes: 9 additions & 3 deletions ansible/config_sonic_basedon_testbed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@
set_fact:
topo: "{{ testbed_facts['topo'] }}"

- name: set default light mode
set_fact:
is_light_mode: false
when: topo in ["t1-smartswitch-ha","t1-28-lag","smartswitch-t1", "t1-48-lag"] and is_light_mode is not defined

- name: set ptf image name
set_fact:
ptf_image: "{{ testbed_facts['ptf_image_name'] }}"
Expand Down Expand Up @@ -624,7 +629,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"]
when: topo in ["t1-smartswitch-ha","t1-28-lag","smartswitch-t1", "t1-48-lag"] and is_light_mode|bool == true

- name: Create dns config
template: src=templates/dns_config.j2
Expand All @@ -636,6 +641,7 @@
topo_name: "{{ topo }}"
port_index_map: "{{ port_index_map | default({}) }}"
hwsku: "{{ hwsku }}"
is_light_mode: "{{ is_light_mode | default(true) }}"
become: true

- name: Copy macsec profile json to dut
Expand Down Expand Up @@ -803,7 +809,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"]
when: topo in ["t1-smartswitch-ha","t1-28-lag","smartswitch-t1", "t1-48-lag"] and is_light_mode|bool == true

- name: Load DPU config in smartswitch
load_extra_dpu_config:
Expand All @@ -812,7 +818,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"]
when: topo in ["t1-smartswitch-ha","t1-28-lag","smartswitch-t1", "t1-48-lag"] and is_light_mode|bool == true

- name: Configure TACACS
become: true
Expand Down
7 changes: 5 additions & 2 deletions ansible/library/generate_golden_config_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,15 @@ def __init__(self):
port_index_map=dict(require=False, type='dict', default=None),
macsec_profile=dict(require=False, type='str', default=None),
num_asics=dict(require=False, type='int', default=1),
hwsku=dict(require=False, type='str', default=None)),
hwsku=dict(require=False, type='str', default=None),
is_light_mode=dict(require=False, type='bool', default=False)),
supports_check_mode=True)
self.topo_name = self.module.params['topo_name']
self.port_index_map = self.module.params['port_index_map']
self.macsec_profile = self.module.params['macsec_profile']
self.num_asics = self.module.params['num_asics']
self.hwsku = self.module.params['hwsku']
self.is_light_mode = self.module.params['is_light_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 @@ -406,7 +408,8 @@ def generate(self):
config = self.generate_mgfx_golden_config_db()
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"]:
elif self.topo_name in ["t1-smartswitch-ha", "t1-28-lag", "smartswitch-t1", "t1-48-lag"] \
and self.is_light_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