Skip to content

Commit

Permalink
Update smartswitch golden config
Browse files Browse the repository at this point in the history
  • Loading branch information
wen587 committed Dec 12, 2024
1 parent 0957715 commit f52b4a1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
12 changes: 12 additions & 0 deletions ansible/golden_config_db/smartswitch_t1-28-lag.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,5 +107,17 @@
"bridge": "bridge-midplane",
"ip_prefix": "169.254.200.254/24"
}
},
"GNMI": {
"certs": {
"ca_crt": "/etc/sonic/telemetry/dsmsroot.cer",
"server_crt": "/etc/sonic/telemetry/streamingtelemetryserver.cer",
"server_key": "/etc/sonic/telemetry/streamingtelemetryserver.key"
},
"gnmi": {
"client_auth": "true",
"log_level": "2",
"port": "50052"
}
}
}
9 changes: 7 additions & 2 deletions ansible/library/generate_golden_config_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,15 @@ def generate_smartswitch_golden_config_db(self):
ori_config_db = json.loads(out)
if "DEVICE_METADATA" not in ori_config_db or "localhost" not in ori_config_db["DEVICE_METADATA"]:
return "{}"

ori_config_db["DEVICE_METADATA"]["localhost"]["subtype"] = "SmartSwitch"

if "FEATURE" not in ori_config_db or "dhcp_server" not in ori_config_db["FEATURE"]:
return "{}"
ori_config_db["FEATURE"]["dhcp_server"]["state"] = "enabled"

gold_config_db = {
"DEVICE_METADATA": copy.deepcopy(ori_config_db["DEVICE_METADATA"])
"DEVICE_METADATA": copy.deepcopy(ori_config_db["DEVICE_METADATA"]),
"FEATURE": copy.deepcopy(ori_config_db["FEATURE"])
}

# Generate dhcp_server related configuration
Expand Down

0 comments on commit f52b4a1

Please sign in to comment.