Ansible: os.Environ() should always be passed to the ansible command.
Fixes GH-3271 Regression introduced in GH-3203
This commit is contained in:
parent
cc8974754f
commit
f823725e53
|
@ -262,8 +262,8 @@ func (p *Provisioner) executeAnsible(ui packer.Ui, comm packer.Communicator, pri
|
||||||
|
|
||||||
cmd := exec.Command(p.config.Command, args...)
|
cmd := exec.Command(p.config.Command, args...)
|
||||||
|
|
||||||
|
cmd.Env = os.Environ()
|
||||||
if len(envvars) > 0 {
|
if len(envvars) > 0 {
|
||||||
cmd.Env = os.Environ()
|
|
||||||
cmd.Env = append(cmd.Env, envvars...)
|
cmd.Env = append(cmd.Env, envvars...)
|
||||||
} else if !checkHostKey {
|
} else if !checkHostKey {
|
||||||
cmd.Env = append(cmd.Env, "ANSIBLE_HOST_KEY_CHECKING=False")
|
cmd.Env = append(cmd.Env, "ANSIBLE_HOST_KEY_CHECKING=False")
|
||||||
|
|
Loading…
Reference in New Issue