From b771068369c46ce3c0acf9706f76ced787ac21b4 Mon Sep 17 00:00:00 2001 From: Denis Gukov Date: Sat, 11 Sep 2021 02:54:35 +0500 Subject: [PATCH] feat(be): ignore known hosts file --- api/tasks/runner.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/tasks/runner.go b/api/tasks/runner.go index 0b8ae5fb..7b30e9d1 100644 --- a/api/tasks/runner.go +++ b/api/tasks/runner.go @@ -393,7 +393,7 @@ func (t *task) updateRepository() error { switch t.repository.SSHKey.Type { case db.AccessKeySSH: - gitSSHCommand := "ssh -o StrictHostKeyChecking=no -i " + t.repository.SSHKey.GetPath() + gitSSHCommand := "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i " + t.repository.SSHKey.GetPath() cmd.Env = t.envVars(util.Config.TmpPath, util.Config.TmpPath, &gitSSHCommand) case db.AccessKeyNone: cmd.Env = t.envVars(util.Config.TmpPath, util.Config.TmpPath, nil) @@ -453,7 +453,7 @@ func (t *task) runGalaxy(args []string) error { cmd := exec.Command("ansible-galaxy", args...) //nolint: gas cmd.Dir = t.getRepoPath() - gitSSHCommand := "ssh -o StrictHostKeyChecking=no -i " + t.repository.SSHKey.GetPath() + gitSSHCommand := "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i " + t.repository.SSHKey.GetPath() cmd.Env = t.envVars(util.Config.TmpPath, cmd.Dir, &gitSSHCommand) t.logCmd(cmd)