Skip to content

Commit 783309b

Browse files
committed
refactor(config): env assignment order
1 parent bd77762 commit 783309b

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

db_lib/AnsiblePlaybook.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,12 @@ func (p AnsiblePlaybook) makeCmd(command string, args []string, environmentVars
2222
cmd := exec.Command(command, args...) //nolint: gas
2323
cmd.Dir = p.GetFullPath()
2424

25-
cmd.Env = append(cmd.Env, fmt.Sprintf("HOME=%s", util.Config.TmpPath))
26-
cmd.Env = append(cmd.Env, fmt.Sprintf("PWD=%s", cmd.Dir))
2725
cmd.Env = append(cmd.Env, "PYTHONUNBUFFERED=1")
2826
cmd.Env = append(cmd.Env, "ANSIBLE_FORCE_COLOR=True")
2927
cmd.Env = append(cmd.Env, fmt.Sprintf("PATH=%s", os.Getenv("PATH")))
3028
cmd.Env = append(cmd.Env, getEnvironmentVars()...)
31-
32-
// TODO: Following option doesn't work when password authentication used.
33-
// So, we need to check args for --ask-pass, --ask-become-pass or remove this code completely.
34-
// What reason to use this code: prevent hanging of semaphore when host key confirmation required.
35-
//cmd.Env = append(cmd.Env, "ANSIBLE_SSH_ARGS=\"-o BatchMode=yes\"")
29+
cmd.Env = append(cmd.Env, fmt.Sprintf("HOME=%s", util.Config.TmpPath))
30+
cmd.Env = append(cmd.Env, fmt.Sprintf("PWD=%s", cmd.Dir))
3631

3732
if environmentVars != nil {
3833
cmd.Env = append(cmd.Env, *environmentVars...)

0 commit comments

Comments
 (0)