Skip to content

Commit b771068

Browse files
committed
feat(be): ignore known hosts file
1 parent 2c9bc5b commit b771068

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

api/tasks/runner.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ func (t *task) updateRepository() error {
393393

394394
switch t.repository.SSHKey.Type {
395395
case db.AccessKeySSH:
396-
gitSSHCommand := "ssh -o StrictHostKeyChecking=no -i " + t.repository.SSHKey.GetPath()
396+
gitSSHCommand := "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i " + t.repository.SSHKey.GetPath()
397397
cmd.Env = t.envVars(util.Config.TmpPath, util.Config.TmpPath, &gitSSHCommand)
398398
case db.AccessKeyNone:
399399
cmd.Env = t.envVars(util.Config.TmpPath, util.Config.TmpPath, nil)
@@ -453,7 +453,7 @@ func (t *task) runGalaxy(args []string) error {
453453
cmd := exec.Command("ansible-galaxy", args...) //nolint: gas
454454
cmd.Dir = t.getRepoPath()
455455

456-
gitSSHCommand := "ssh -o StrictHostKeyChecking=no -i " + t.repository.SSHKey.GetPath()
456+
gitSSHCommand := "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i " + t.repository.SSHKey.GetPath()
457457
cmd.Env = t.envVars(util.Config.TmpPath, cmd.Dir, &gitSSHCommand)
458458

459459
t.logCmd(cmd)

0 commit comments

Comments
 (0)