From 8c428e397431d19d8957dcc0cf51f88576fb0736 Mon Sep 17 00:00:00 2001 From: aoi96 <15664626+aoi96@users.noreply.github.com> Date: Thu, 28 Dec 2023 04:12:11 +0000 Subject: [PATCH] fix creating janoger user when node start --- nodes/sonic/sonic.go | 6 ++++++ nodes/srl/srl.go | 4 ++++ nodes/vr_n9kv/vr-n9kv.go | 3 ++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/nodes/sonic/sonic.go b/nodes/sonic/sonic.go index eb020f58e..a40422d7c 100644 --- a/nodes/sonic/sonic.go +++ b/nodes/sonic/sonic.go @@ -66,5 +66,11 @@ func (s *sonic) PostDeploy(ctx context.Context, _ *nodes.PostDeployParams) error return fmt.Errorf("failed post-deploy node %q: %w", s.Cfg.ShortName, err) } + cmd, _ = exec.NewExecCmdFromString("service ssh start") + err = s.RunExecNotWait(ctx, cmd) + if err != nil { + return fmt.Errorf("failed post-deploy node %q: %w", s.Cfg.ShortName, err) + } + return nil } diff --git a/nodes/srl/srl.go b/nodes/srl/srl.go index 9772f4123..2e700ff67 100644 --- a/nodes/srl/srl.go +++ b/nodes/srl/srl.go @@ -69,6 +69,10 @@ set / system snmp community public set / system snmp network-instance mgmt set / system snmp network-instance mgmt admin-state enable set / system lldp admin-state enable +set / system configuration role network-admin rule / action write +set / system aaa authorization role network-admin services [ cli ] +set / system aaa authentication user janoger password netcon! +set / system aaa authentication user janoger role [ network-admin ] set / system aaa authentication idle-timeout 7200 {{- /* if e.g. node is run with none mgmt networking but a macvlan interface is attached as mgmt0, we need to adjust the mtu */}} {{- if ne .MgmtMTU 0 }} diff --git a/nodes/vr_n9kv/vr-n9kv.go b/nodes/vr_n9kv/vr-n9kv.go index a229526d5..255b2b931 100644 --- a/nodes/vr_n9kv/vr-n9kv.go +++ b/nodes/vr_n9kv/vr-n9kv.go @@ -17,7 +17,8 @@ import ( var ( kindnames = []string{"cisco_n9kv", "vr-n9kv", "vr-cisco_n9kv"} - defaultCredentials = nodes.NewCredentials("admin", "admin") + //defaultCredentials = nodes.NewCredentials("admin", "admin") + defaultCredentials = nodes.NewCredentials("janoger", "netcon!") ) const (