Skip to content

Env var to skip ssh provisioning on sr os nodes #1756

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 29, 2023
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
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