From 8932ea2e137e8db10e01d96b9198911023d59ff9 Mon Sep 17 00:00:00 2001 From: Denis Gukov Date: Wed, 13 Nov 2024 12:33:01 -0500 Subject: [PATCH] feat(be): disable host key checking by default (#2535) * feat(be): disable host key checking by default * test(be): pass test * chore: simplify code --- db_lib/AnsiblePlaybook.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/db_lib/AnsiblePlaybook.go b/db_lib/AnsiblePlaybook.go index e75eba54..f52cbb3a 100644 --- a/db_lib/AnsiblePlaybook.go +++ b/db_lib/AnsiblePlaybook.go @@ -6,10 +6,10 @@ import ( "os/exec" "strings" + "github.com/creack/pty" "github.com/semaphoreui/semaphore/db" "github.com/semaphoreui/semaphore/pkg/task_logger" "github.com/semaphoreui/semaphore/util" - "github.com/creack/pty" ) 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, "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, fmt.Sprintf("HOME=%s", util.Config.TmpPath)) cmd.Env = append(cmd.Env, fmt.Sprintf("PWD=%s", cmd.Dir))