Skip to content

Commit

Permalink
Env var to skip ssh provisioning on sr os nodes (#1756)
Browse files Browse the repository at this point in the history
introduced env var to skip ssh provisioning on sr os nodes
  • Loading branch information
hellt authored Nov 29, 2023
1 parent b63b35f commit 7f35e25
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
9 changes: 9 additions & 0 deletions docs/manual/kinds/vr-sros.md
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,15 @@ Containerlab v0.48.0+ supports SSH key injection into the Nokia SR OS nodes. Fir

Next it will filter out public keys that are not of RSA/ECDSA type. The remaining valid public keys will be configured for the admin user of the Nokia SR OS node using key IDs from 32 downwards[^2]. This will enable key-based authentication next time you connect to the node.

/// details | Skipping keys injection
If you want to disable this feature (e.g. when using classic CLI mode), you can do so by setting the `CLAB_SKIP_SROS_SSH_KEY_CONFIG=true` env variable:

```bash
CLAB_SKIP_SROS_SSH_KEY=true sudo -E clab deploy -t <topo-file>
```

///

### License

Path to a valid license must be provided for all Nokia SR OS nodes with a [`license`](../nodes.md#license) directive.
Expand Down
1 change: 1 addition & 0 deletions docs/rn/0.48.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,4 @@ Now containerlab will add group ACLs to the lab directory to allow original user

* fixed `destroy -t <dir>` case where topology file referred a directory #1747
* fixed SR OS getting stuck when partial config is used with ssh keys provisioning #1750
* introduced `CLAB_SKIP_SROS_SSH_KEY_CONFIG` env var to skip SSH key provisioning for SR OS #1756
8 changes: 7 additions & 1 deletion nodes/vr_sros/vr-sros.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,13 @@ func (s *vrSROS) PostDeploy(ctx context.Context, _ *nodes.PostDeployParams) erro
log.Infof("%s: configuration applied", s.Cfg.LongName)
}

if len(s.sshPubKeys) > 0 {
// skip ssh key configuration if CLAB_SKIP_SROS_SSH_KEY_CONFIG env var is set
// which is needed for SR OS nodes running in classic CLI mode, because our key
// injection mechanism assumes MD-CLI mode.
_, skipSSHKeyCfg := os.LookupEnv("CLAB_SKIP_SROS_SSH_KEY_CONFIG")

if len(s.sshPubKeys) > 0 && !skipSSHKeyCfg {
log.Warn("here1")
err := s.configureSSHPublicKeys(ctx)
if err != nil {
return err
Expand Down

0 comments on commit 7f35e25

Please sign in to comment.