Skip to content

Commit

Permalink
[tacacs]: Restore from TACACS backup if present, upon load-minigraph …
Browse files Browse the repository at this point in the history
…during update-graph action. (sonic-net#6407)

Why I did it
During upgrade, if config is loaded from minigraph, it would miss TACACS credentials. This leads to device losing remote user accessibility

- How I did it
During update graph, when config is loaded from minigraph, look for TACACS credentials back-up and load that if available

- How to verify it
Remove /etc/sonic/config-db.json, save TACACS credentials in /etc/sonic/tacacs.json and do a Image upgrade. Do image upgrade and boot into new image. Verify remote user access is available.

NOTE: This change is available in master via PR sonic-net#6285
  • Loading branch information
renukamanavalan authored Jan 11, 2021
1 parent abdbda9 commit b2e3ba8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions files/image_config/updategraph/updategraph
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash

CONFIG_DB_INDEX=4
TACACS_JSON_BACKUP=tacacs.json

reload_minigraph()
{
Expand All @@ -15,6 +16,11 @@ reload_minigraph()
acl-loader update full /etc/sonic/acl.json
fi
config qos reload
if [ -r /etc/sonic/old_config/${TACACS_JSON_BACKUP} ]; then
sonic-cfggen -j /etc/sonic/old_config/${TACACS_JSON_BACKUP} --write-to-db
else
echo "Missing tacacs json to restore tacacs credentials"
fi
DEVICE_TYPE=`sonic-cfggen -m -v DEVICE_METADATA.localhost.type`
if [ "${DEVICE_TYPE}" != "MgmtToRRouter" ]; then
pfcwd start_default
Expand Down

0 comments on commit b2e3ba8

Please sign in to comment.