Skip to content

Commit

Permalink
feat(be): ignore known hosts file
Browse files Browse the repository at this point in the history
  • Loading branch information
fiftin committed Sep 10, 2021
1 parent 2c9bc5b commit b771068
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/tasks/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit b771068

Please sign in to comment.