feat(be): disable host key checking by default (#2535)
Some checks failed
Dev / build-local (push) Has been cancelled
Dev / migrate-boltdb (push) Has been cancelled
Dev / migrate-mysql (push) Has been cancelled
Dev / migrate-mariadb (push) Has been cancelled
Dev / migrate-postgres (push) Has been cancelled
Dev / integrate-boltdb (push) Has been cancelled
Dev / integrate-mysql (push) Has been cancelled
Dev / integrate-mariadb (push) Has been cancelled
Dev / integrate-postgres (push) Has been cancelled
Dev / deploy-server (push) Has been cancelled
Dev / deploy-runner (push) Has been cancelled

* feat(be): disable host key checking by default

* test(be): pass test

* chore: simplify code
This commit is contained in:
Denis Gukov 2024-11-13 12:33:01 -05:00 committed by GitHub
parent 70f15f4404
commit 8932ea2e13
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -6,10 +6,10 @@ import (
"os/exec" "os/exec"
"strings" "strings"
"github.com/creack/pty"
"github.com/semaphoreui/semaphore/db" "github.com/semaphoreui/semaphore/db"
"github.com/semaphoreui/semaphore/pkg/task_logger" "github.com/semaphoreui/semaphore/pkg/task_logger"
"github.com/semaphoreui/semaphore/util" "github.com/semaphoreui/semaphore/util"
"github.com/creack/pty"
) )
type AnsiblePlaybook struct { type AnsiblePlaybook struct {
@ -24,6 +24,7 @@ func (p AnsiblePlaybook) makeCmd(command string, args []string, environmentVars
cmd.Env = append(cmd.Env, "PYTHONUNBUFFERED=1") cmd.Env = append(cmd.Env, "PYTHONUNBUFFERED=1")
cmd.Env = append(cmd.Env, "ANSIBLE_FORCE_COLOR=True") cmd.Env = append(cmd.Env, "ANSIBLE_FORCE_COLOR=True")
cmd.Env = append(cmd.Env, "ANSIBLE_HOST_KEY_CHECKING=False")
cmd.Env = append(cmd.Env, getEnvironmentVars()...) cmd.Env = append(cmd.Env, getEnvironmentVars()...)
cmd.Env = append(cmd.Env, fmt.Sprintf("HOME=%s", util.Config.TmpPath)) cmd.Env = append(cmd.Env, fmt.Sprintf("HOME=%s", util.Config.TmpPath))
cmd.Env = append(cmd.Env, fmt.Sprintf("PWD=%s", cmd.Dir)) cmd.Env = append(cmd.Env, fmt.Sprintf("PWD=%s", cmd.Dir))