@@ -22,17 +22,12 @@ func (p AnsiblePlaybook) makeCmd(command string, args []string, environmentVars
22
22
cmd := exec .Command (command , args ... ) //nolint: gas
23
23
cmd .Dir = p .GetFullPath ()
24
24
25
- cmd .Env = []string {}
26
-
27
- cmd .Env = append (cmd .Env , fmt .Sprintf ("HOME=%s" , util .Config .TmpPath ))
28
- cmd .Env = append (cmd .Env , fmt .Sprintf ("PWD=%s" , cmd .Dir ))
29
25
cmd .Env = append (cmd .Env , "PYTHONUNBUFFERED=1" )
30
26
cmd .Env = append (cmd .Env , "ANSIBLE_FORCE_COLOR=True" )
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\"")
27
+ cmd .Env = append (cmd .Env , fmt .Sprintf ("PATH=%s" , os .Getenv ("PATH" )))
28
+ cmd .Env = append (cmd .Env , getEnvironmentVars ()... )
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 ))
36
31
37
32
if environmentVars != nil {
38
33
cmd .Env = append (cmd .Env , * environmentVars ... )
0 commit comments